Skip to content

Pre-transform error: Can't resolve 'tailwindcss' #1000

@gspgsp

Description

@gspgsp

Environment

Working directory: /home/Documents/code/duoxiaozhan-www nuxi 11:41:57 PM
Nuxt project info: (copied to clipboard) nuxi 11:41:57 PM



👉 Report an issue: https://github.com/nuxt/nuxt/issues/new?template=bug-report.yml
👉 Suggest an improvement: https://github.com/nuxt/nuxt/discussions/new
👉 Read documentation: https://nuxt.com

Reproduction

No response

Describe the bug

after i run

npm install @nuxtjs/tailwindcss

it will install the latest version:

"@nuxtjs/tailwindcss": "^7.0.0-beta.0"

then run:

npm run dev

it will report:

 ERROR  Pre-transform error: Can't resolve 'tailwindcss' in '/home/Documents/code/duoxiaozhan-www'                                                                                                              11:41:45 PM
  Plugin: @tailwindcss/vite:generate:serve
  File: virtual:nuxt:%2Fhome%2FDocuments%2Fcode%2Fduoxiaozhan-www%2F.nuxt%2Ftailwind.css

i checked the .nuxt directory, and found there is a file named:

tailwind.css, and the content is the following:
**@import 'tailwindcss';
@import "/home/Documents/code/duoxiaozhan-www/.nuxt/tailwindcss/sources.css";**

Additional context

i don't know how to solve this problem, i think it has something to do with the the version, so i set the version to v6, like the following:

"@nuxtjs/tailwindcss": "^6.14.0"

and run npm install, then npm run dev, now it worked well

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions