-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
fix(create-vite): update tsconfig with moduleDetection force #17468
fix(create-vite): update tsconfig with moduleDetection force #17468
Conversation
|
Is there a reason to only apply to the react and preact templates? Should it be applied to all tsconfigs that has |
I was able to reproduce the error just Also I only have experience with react and preact... perhaps someone with experience in these frameworks can take care of the updates. |
I think we should update it for the rest of the templates. It's not related to frameworks specifically. If you use |
Yes, you are right: demo |
react
and preact
templates (fix: #17443)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Description
fix #17443
Problem solved:
With the current configuration, the application may compile successfully but fail at runtime.
Reproducible example here:https://stackblitz.com/edit/vitejs-vite-srbrdd
Reproduction
https://stackblitz.com/edit/vitejs-vite-srbrdd?file=tsconfig.json
Steps to reproduce
ts
file inside thesrc
folder (for examplenewfile.ts
) with this content:const MY_CONST = 1
App.tsx
:{MY_CONST}
,At this point, you should be able to compile (with
npx tsc --noEmit
) or build the app (npm run build
) without errors, but the app fails at runtime (npm run dev
) in the preview.Notes:
I was only able to reproduce this with the react and react templates.