vitjs / vit

🚀 React application framework inspired by UmiJS / 类 UmiJS 的 React 应用框架
MIT License
100 stars 7 forks source link

请教下你咋解决这个错误得 error TS7016: Could not find a declaration file for module 'react-color'. #3

Closed aadog closed 2 years ago

aadog commented 2 years ago

yarn run v1.22.17 $ tsc && vite build node_modules/@ant-design/pro-form/lib/components/ColorPicker/index.d.ts:2:40 - error TS7016: Could not find a declaration file for module 'react-color'. 'C:/Users/pwt/src/vitereacttest/node_modules/react-color/lib/index.js' implicitly has an 'any' type. Try npm i --save-dev @types/react-color if it exists or add a new declaration (.d.ts) file containing declare module 'react-color';

2 import type { SketchPickerProps } from 'react-color';


node_modules/@ant-design/pro-utils/lib/types/index.d.ts:4:40 - error TS7016: Could not find a declaration file for module 'react-color'. 'C:/Users/pwt/src/vitereacttest/node_modules/react-color/lib/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/react-color` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-color';`

4 import type { SketchPickerProps } from 'react-color';

Found 2 errors in 2 files.

Errors Files 1 node_modules/@ant-design/pro-form/lib/components/ColorPicker/index.d.ts:2 1 node_modules/@ant-design/pro-utils/lib/types/index.d.ts:4 error Command failed with exit code 2. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

yunsii commented 2 years ago

看起来这是这仅是 tsc 导致的类型报错,可以先装个 https://www.npmjs.com/package/@types/react-color 试试;tsconfig 还有个 skipLibCheck 的配置,另外实在不行了可以在 build 时不执行 tsc。

aadog commented 2 years ago

多谢,太喜欢这个项目了,有交流群吗

aadog commented 2 years ago

我从html->umi3->ice->umi4都来一圈了,准备vite重构下,vit太理想了

yunsii commented 2 years ago

现在能力比较有限,项目也还比较初级,还是更适合 issue 或者邮件的沟通方式。有什么问题通过这两种方式就行了。

aadog commented 2 years ago

有意向添加umi中得 access request model initialState 吗,有着几个功能就行了,layout不是主要

yunsii commented 2 years ago

这应该需要结合插件机制来做,不然这几个功能也不一定是其他人需要的。

aadog commented 2 years ago

@yunsii 大哥,我做了一个版本,基于vite插件的,要不要一起讨论下,我实现了 request antd appdata

yunsii commented 2 years ago

可以,QQ或者微信?