Vite ignores useDefineForClassFields
in nested tsconfigs when using ts project references
#18297
Closed
7 tasks done
Labels
bug: upstream
Bug in a dependency of Vite
has workaround
p3-minor-bug
An edge case that only affects very specific usage (priority)
Describe the bug
When I use
react-ts
template and try to usemobx
inside, then I get wrong behavior because mobx require ts compiler option"useDefineForClassFields": true
, butvite
loose this optin when it is defined in referenced tsconfig file.It is
vite
bug, nottsc
. To demonstrate this I remove options"noEmit": true
and"allowImportingTsExtensions": true
fromtsconfig.app.json
andtsconfig.node.json
and runnpm run build
. For this setup I will see two result JS files (compiled bytsc
and byvite
).Similar errors:
useDefineForClassFields
is set to true #11722 - I think my issue is not about the order of field initializationReproduction
https://stackblitz.com/edit/vitejs-vite-va8v8j?file=src%2Fmain.tsx
Steps to reproduce
npm create vite@latest vite-react-ts -- --template react-ts
cd ./vite-react-ts
npm i
public
folder and all files insrc
expectmain.tsx
main.tsx
with:npm run dev
System Info
Used Package Manager
npm
Logs
Click to expand vite debug log
Validations
The text was updated successfully, but these errors were encountered: