-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
Cannot access ambient const enums when the '--isolatedModules' flag is provided. #5814
Comments
I also encountered the same problem |
I recently reread the vite docs to make sure I was up to date and updated my tsconfig accordingly (see https://vitejs.dev/guide/features.html#typescript-compiler-options) and am seeing this as well. Just adding this note so in case docs need to be updated one way or another... |
similar issues here, for now I just turn isolatedModules to false to avoid them |
Exactly the same problem |
Same problem, followed the docs and it breaks the application |
Okay so it looks like this is happening because https://www.typescriptlang.org/tsconfig#skipLibCheck Is it safe to turn it off?
|
I have few days ago created a project using I am also asking because in VScode a simple component like:
Shows an error with |
It's a issue with vue vuejs/core#1228. |
isolatedModules flag was causing vuejs reactivity compilation errors. See error below and vitejs/vite#5814 & vuejs/core#1228 ``` node_modules/@vue/reactivity/dist/reactivity.d.ts:26:15 - error TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided. 26 readonly [ReactiveFlags.IS_READONLY]: boolean; ``` noImplicitAny flag was causing compilation errors when using named slots.
Default template can't build due to this error: "Cannot access ambient const enums when the '--isolatedModules' flag is provided." The errors are in node_modules/@vue/runtime-core so we can actually just have ts skip checking files in node_modules. See vitejs/vite#5814
Same problem here. I can currently work around it but when it comes to release I'd like to get it working. |
in ...
"isolatedModules": false,
...
} |
@patak-dev Shouldn't this be fixed usptream in Vue core instead? Not checking all libs is a big hammer. |
There is an issue tracking it upstream. At least from Vite's side, I think it is ok to close this issue |
Until it is fixed upstream, the vite docs should either be modified to remove the isolated modules note, or an extra note with a caveat and link to the upstream issue should be added. Very confusing for new users following the recommended setup instructions. |
@bluwy should we add a note about |
Sounds like a harmless change 👍 I've created #7785 to add a small note for it. |
Describe the bug
Even with a minimal setup, vue-tsc fire errors when
isolatedModules
flag is activeReproduction
https://github.com/francoislevesque/vite-issue
What I did
Very simple:
Set
isolatedModules
totrue
in tsconfig.json.Get the following errors:
System Info
Used Package Manager
npm
Logs
Validations
The text was updated successfully, but these errors were encountered: