Cannot find module 'xxx/vite' or its corresponding type declarations #336
Closed
pany-ang
started this conversation in
Show and tell
Replies: 2 comments 2 replies
-
The suggestion solution is
|
Beta Was this translation helpful? Give feedback.
2 replies
-
For the latest version, we've already support all kinds of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
如果 ts 版本小于 5,那么出现这个告警的原因应该是最新版 vscode,测试后发现好像 vscode 1.74 以及更早的版本不会出现该告警(这种情况下,你几乎只能忍着这个警告不管,其他措施会导致 build 报错,或者降低你的 vscode 版本)
如果 ts 版本大于 5,那么你可以选择将 moduleResolution 配置为 bundler,但是这样的话,其他依赖(比如 Element Plus)可能就会疯狂报错(等待官方修复这个问题中...)。你也可以选择“// @ts-expect-error”来忽略这个错误,忽略后能正常 build
ts 小于 5,并且又是最新版 vscode 时最难受,几乎处理不了这个报错
所以总结一下,如果 ts 小于 5,那么就不要去管它,issues 里面的别人给的方法,几乎都会导致 build 出错。如果 ts 大于 5,那么就暂时用“// @ts-expect-error”来忽略这个错误,这样能正常 build
If the TS version is less than 5, then the reason for this alarm should be the latest version of VSCODE, after testing, it seems that VSCODE 1.74 and earlier versions will not appear this alarm (in this case, you can almost only endure this warning, other measures will cause build errors, or reduce your VSCODE version)
If the ts version is greater than 5, then you can choose to configure moduleResolution as a bundler, but in this case, other dependencies (such as Element Plus) may report crazy errors (waiting for the official fix of this problem...). )。 You can also select "// @ts-expect-error" to ignore this error, and it will build normally after ignoring it
TS is less than 5, and it is the most uncomfortable when the latest version of VSCODE, and it is almost impossible to handle this error
So to sum up, if ts is less than 5, then don't care about it, the methods given by others in issues will almost always cause build errors. If ts is greater than 5, then temporarily ignore this error with "// @ts-expect-error", so that it can build normally
Beta Was this translation helpful? Give feedback.
All reactions