Skip to content

(reactivity) Type check fails when '--isolatedModules' flag is provided #1228

Closed
@sapphi-red

Description

@sapphi-red

Version

3.0.0-beta.14

Reproduction link

https://github.com/sapphi-red/vite-reactivity-isolated-modules-minimal-reproduction

Steps to reproduce

  1. $ npm i
  2. $ 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.✨ feature requestNew feature or requesthas PRA pull request has already been submitted to solve the issuescope: types

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions