nextjs - 💡(How to fix) Fix [Turbopack] Can't resolve 'tailwindcss' bare CSS @import when project parent directory has no package.json [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#92452Fetched 2026-04-08 02:59:54
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
closed ×1commented ×1labeled ×1locked ×1

When using Tailwind v4's bare @import "tailwindcss" in globals.css, Turbopack fails to resolve the module. The resolver walks up past the project root to the parent directory (e.g. C:\Users\<user>\Desktop) and attempts node_modules lookup there, where no package.json exists.

Error: Can't resolve 'tailwindcss' in 'C:\Users<user>\Desktop' No description file found in C:\Users<user>\Desktop or above

Error Message

Error:

Root Cause

When using Tailwind v4's bare @import "tailwindcss" in globals.css, Turbopack fails to resolve the module. The resolver walks up past the project root to the parent directory (e.g. C:\Users\<user>\Desktop) and attempts node_modules lookup there, where no package.json exists.

Error: Can't resolve 'tailwindcss' in 'C:\Users<user>\Desktop' No description file found in C:\Users<user>\Desktop or above

RAW_BUFFERClick to expand / collapse

Bug Report

Environment

  • Next.js: 16.1.1 (Turbopack)
  • tailwindcss: ^4
  • @tailwindcss/postcss: ^4
  • OS: Windows 11

Description

When using Tailwind v4's bare @import "tailwindcss" in globals.css, Turbopack fails to resolve the module. The resolver walks up past the project root to the parent directory (e.g. C:\Users\<user>\Desktop) and attempts node_modules lookup there, where no package.json exists.

Error: Can't resolve 'tailwindcss' in 'C:\Users<user>\Desktop' No description file found in C:\Users<user>\Desktop or above

Reproduction

  1. Create a Next.js 16 project inside a directory whose parent has no package.json (e.g. C:\Users\<user>\Desktop\my-app)
  2. Use Tailwind v4 with @import "tailwindcss" in globals.css
  3. Run npm run dev (Turbopack)

Expected behavior

Turbopack resolves bare CSS @import specifiers relative to the project root (where package.json exists), not the parent directory.

extent analysis

TL;DR

Modify the globals.css file to use a relative path for the Tailwind import or configure Turbopack to resolve modules relative to the project root.

Guidance

  • Verify that the package.json file exists in the project root and contains the necessary dependencies, including tailwindcss and @tailwindcss/postcss.
  • Check the Turbopack configuration to see if there are any options available to specify the resolution path for modules.
  • Consider using a relative path for the Tailwind import in globals.css, such as @import "./node_modules/tailwindcss/base.css";, to avoid relying on the resolver.
  • If possible, try moving the project to a directory whose parent contains a package.json file to see if the issue is specific to the current directory structure.

Example

No code example is provided as the issue is related to configuration and resolution paths rather than code syntax.

Notes

The issue seems to be specific to the combination of Next.js 16.1.1, Turbopack, and Tailwind v4, and may be related to how Turbopack resolves modules. Further investigation into Turbopack's configuration options may be necessary to find a solution.

Recommendation

Apply a workaround, such as using a relative path for the Tailwind import, as the root cause of the issue is likely related to Turbopack's resolution path and may require a fix from the Turbopack team.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Turbopack resolves bare CSS @import specifiers relative to the project root (where package.json exists), not the parent directory.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING