nextjs - 💡(How to fix) Fix Tailwind config cannot import local TS modules in Next.js 16.1.x [3 comments, 4 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#88049Fetched 2026-04-08 02:05:33
View on GitHub
Comments
3
Participants
4
Timeline
9
Reactions
0
Author
Timeline (top)
commented ×3closed ×2labeled ×2issue_type_added ×1

Error Message

  • Error is reported as Module not found Not error

Code Example

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 10 Pro
  Available memory (MB): 16192
  Available CPU cores: 20
Binaries:
  Node: 24.12.0
  npm: 11.6.2
  Yarn: 1.22.22
  pnpm: N/A
Relevant Packages:
  next: 16.1.1 // Latest available version is detected (16.1.1).
  eslint-config-next: N/A
  react: 19.2.3
  react-dom: 19.2.3
  typescript: 5.9.3
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/tailwind-config-cannot-import-local-ts-modules-in-next-js-16-1-x-forked-tng34x

To Reproduce

  • Start app in dev mode (next dev)
  • Open console to check bug

Current vs. Expected behavior

Actual behavior:

  • Error is reported as Module not found
  • Project still runs

Expected behavior:

Not error

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 10 Pro
  Available memory (MB): 16192
  Available CPU cores: 20
Binaries:
  Node: 24.12.0
  npm: 11.6.2
  Yarn: 1.22.22
  pnpm: N/A
Relevant Packages:
  next: 16.1.1 // Latest available version is detected (16.1.1).
  eslint-config-next: N/A
  react: 19.2.3
  react-dom: 19.2.3
  typescript: 5.9.3

Which area(s) are affected? (Select all that apply)

Turbopack

Which stage(s) are affected? (Select all that apply)

next dev (local), next build (local)

Additional context

After upgrading from Next.js 16.0.10 to 16.1.x, tailwind.config.ts can no longer import local TypeScript modules, even when using explicit relative paths. The same configuration works correctly in 16.0.10.

extent analysis

TL;DR

The issue can be fixed by adjusting the import paths or configuration in tailwind.config.ts to accommodate changes in Next.js 16.1.x.

Guidance

  • Verify that the file paths in tailwind.config.ts are correct and try using absolute paths or paths relative to the project root.
  • Check the Next.js documentation for any changes to how local modules are resolved in version 16.1.x.
  • Consider downgrading to Next.js 16.0.10 temporarily to confirm if the issue is indeed related to the upgrade.
  • Review the Turbopack configuration to ensure it is compatible with the new version of Next.js.

Example

No specific code example can be provided without modifying the original code, but adjusting import paths in tailwind.config.ts might look like changing import './local-module' to import '../../local-module' if the file structure has changed or if the resolution of modules has been altered by the Next.js update.

Notes

The exact solution may depend on the specifics of the project structure and how Next.js 16.1.x handles module imports differently than version 16.0.10. The provided environment information and the fact that the issue arises after a version upgrade suggest that the problem is related to compatibility changes.

Recommendation

Apply a workaround by adjusting import paths or configurations in tailwind.config.ts until a more permanent solution or an official fix from Next.js is available, as downgrading might not be a viable long-term solution.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING