Closed
Description
Version
3.0.0-beta.14
Reproduction link
https://github.com/sapphi-red/vite-reactivity-isolated-modules-minimal-reproduction
Steps to reproduce
$ npm i
$ npm run check
What is expected?
no error with Cannot access ambient const enums when the '--isolatedModules' flag is provided.
What is actually happening?
error was found as below
node_modules/@vue/runtime-core/dist/runtime-core.d.ts:950:10 - error TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided.
950 export { TrackOpTypes }
~~~~~~~~~~~~
node_modules/@vue/runtime-core/dist/runtime-core.d.ts:976:10 - error TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided.
976 export { TriggerOpTypes }
~~~~~~~~~~~~~~
Note that because esbuild only performs transpilation without type information, it doesn't support certain features like const enum and implicit type-only imports. You must set "isolatedModules": true in your tsconfig.json under compilerOptions so that TS will warn you against the features that do not work with isolated transpilation.
https://github.com/vitejs/vite#typescript
I turned on isolatedModules
because vite recommends it.