"Cannot write file '...' because it would overwrite input file" error in tsconfig.json
Hello.
I created a Nuxt app with
bunx nuxi@latest init www-nuxt
. I added t3-env/nuxt
and then I added TailwindCSS following their Nuxt guide.
I went ahead to add a simple route in the server and a page in the client.
This runs fine with bun dev
, however, I keep getting an error in server/tsconfig.json
: Cannot write file '/home/shig07770/Programming/ts-devkit/projects/www-nuxt/tailwind.config.js' because it would overwrite input file.ts
. However, this file only contains:
I tried removing the .nuxt
directory and then regenerating the files with bun dev
but the error is still there. This is also not a VS Code issue because it didn't go away when I reloaded the window.5 Replies
Reproducing the error
- Run
bunx nuxi@latest init nuxt-tsconfig-bug
- Which package manager would you like to use? bun
- Initialize git repository? No
- Run cd nuxt-tsconfig-bug
- Run bun add -D tailwindcss postcss autoprefixer && bunx tailwindcss init
- Write nuxt.config.ts
- Write tailwind.config.js
- Observe error in server/tsconfig.json
Hi @🌺🇫🇷 Shigu :3 🌺 , have you found the solution?
No
In my case it's the Eslint with
.mjs
suffix that is causing the issue. And I don't think it is recommended to change the .mjs
to .ts
(unsure) so as a temporary solution, I had to exclude it in the ~server/tsconfig.json
like this.
In your case, I think the reason for that is the tailwind.config.js
Try changing it to.ts
Thanks, I'll try when I get home