-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Cannot find module '@babel/types' or its corresponding type declarations #5625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
add |
This belongs to the vite vue template: https://github.com/vitejs/vite/issues?q=is%3Aissue+sort%3Aupdated-desc+cannot+find+module+repo%3Ababel%2Ftypes+is%3Aopen |
Does this fix anything or does it just hide the underlying issue? |
It does. |
I'm not sure that this "fixes" the issue as @f1am3d says. It seems like it just hides it to me. Sure, vue-tsc no longer complains about third party code in node_modules, but if you've got *.d.ts files to declare types for other libraries in your project, it skips them on the type check as well. That's not an option in my case. Is there a workaround to avoid node_modules but allow your own .d.ts files? |
I fixed it by installing it !!
|
@Ge6ben it works for me. Thanks! |
fixes: vuejs#5625, vuejs#6891, vuejs#8917 Moved @babel/types from dev dependencies to normal dependencies. In this case npm will correctly resolve dependency under configurations described in related issues.
Version
3.2.31
Reproduction link
reproduction
Steps to reproduce
This project is created by create-vite:
Update dependencies to the latest version then change
src/main.ts
tosrc/index.ts
:Change
vite.config.ts
to build lib:Install project and run:
What is expected?
Build successful.
What is actually happening?
Will take some errors and build fail.
If this is just a problem of
vue-tsc
(volar
), please help migrate this issue, thanks.The text was updated successfully, but these errors were encountered: