-
Notifications
You must be signed in to change notification settings - Fork 94
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
DTS not compatible with latest React Vite tsconfig structure #344
Comments
@mochizin , hello. Is there any updates on this subject? Should we recreate react and vite app with older version? I want to install older version of vite. Which is doesnt have this problem? |
@mochizin , I removed tsconfig.app.json and moved all its content to tsconfig.json. And it started to work properly. I could import UI component to my other project. |
Yeah, this was my solution as well, but it is how Vite do in previous versions. I was looking for some solution/fix that works with latest Vite |
@yestay90, @mochizin, I think this fix must come from this plugin in a future update. Until it happens, this is what I did to fix it on my side: dts({
tsconfigPath: resolve(__dirname, "tsconfig.app.json"),
rollupTypes: true,
}), So, I didn't need to change the "Vite way" of organizing the tsconfig files. |
@willian, I tried to do that previously as well but when I run So this solution doesn't work for me 😕 |
@phuongthuan wow amazing how this works, why does it happen? |
@phuongthuan can't see the file, can you post the code here? |
This also ended up working for me |
Me too after 4 days of searching |
It has been updated in FAQs. |
Thanks for the fix, appreciate it! @willian @phuongthuan |
Any updated on this? Some of these suggested config didn't work for me...
I'm using the same build command as mentioned by @mochizin |
Describe the bug
I'm trying to use DTS with Vite for React 5.3.1
In this version Vite introduced tsconfig.app.json and reference it in tsconfig.json:
For some reason, the tsconfig.app.json is not being recognized by DTS. I get the following error:
or
Module './App.tsx' was resolved to 'libray-ui/src/App.tsx', but '--jsx' is not set.
The solution that I'm using is addEdit: This solution doesn't work properlytsconfigPath: "./tsconfig.app.json",
Is this a good solution?Reproduction
https://stackblitz.com/edit/vitejs-vite-yxnnz2?file=vite.config.ts
Steps to reproduce
Run:
npm create vite@latest
npm install @types/node
npm install --save-dev vite-plugin-dts
vite.config.ts
npm run build
System Info
Validations
The text was updated successfully, but these errors were encountered: