nuxtrdev / nuxtr-vscode

An extension offering commands and tools to make your experience with Nuxt more pleasant.
https://marketplace.visualstudio.com/items?itemName=Nuxtr.nuxtr-vscode
325 stars 12 forks source link

[Bug]: tailwindcss module cannot be find when using tailwind.config.ts #120

Closed philippedasilva-orizone closed 6 months ago

philippedasilva-orizone commented 7 months ago

Environment

Don't know if it will change anything but I setup my Nuxt3 project to enable Volar Take Over Mode and I set typescript: { shim: false } in the nuxt.config.ts file

What went wrong?

I installed tailwindcss using Nuxtr and checking the 3 options on my fresh Nuxt 3 application. It went fine with a success message and when I ran the server, everything was working as intended and tailwindcss classes are well rendered. However, when I open the tailwind.config.ts file, I get an vscode typescript error that says: "Cannot find module 'tailwindcss' or its corresponding type declarations.ts(2307)"

Screenshot 2024-02-09 at 18 01 45

Nothing is blocking me and a quick workaround would be to use the javascript version.

I still wonder what could be done to solve it and if not, maybe change the file template to the javascript version.

How to reproduce it?

adhamfarrag commented 6 months ago

Hi @philippedasilva-orizone,

Just got time to check the issues.

Short version: Just install pnpm i -D tailwindcss@latest will make this issue gone for some users.

Long version: I'm still exploring ways to not gently force users to use TypeScript for everything even if I believe it's way better for your development workflow. But here I had two options, either to make the whole process easier with replace partial configuration steps (installation, file creation) with just chosing (JS/TS files) or add it as an extra step but didn't have time to check choices validation with VSCode API docs yet. Was easier for me for now to replace the JS template until I investigate this best decision.

adhamfarrag commented 5 months ago

Hello @philippedasilva-orizone, Nuxtr 0.2.16 should include a step to install tailwindcss package by default. Please update.