nextjs - ✅(Solved) Fix Tailwind config throws `Module not found` on Next.js 16.1.1 (works on 16.0) [2 pull requests, 5 comments, 6 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#87898Fetched 2026-04-08 02:05:50
View on GitHub
Comments
5
Participants
6
Timeline
36
Reactions
21
Timeline (top)
subscribed ×15commented ×5referenced ×5cross-referenced ×3

Error Message

The error does not seem to break the build, and the code continues to function. I believe this is a Turbopack issue introduced in this minor version as running the scripts with the --webpack flags removes the error.

Fix Action

Fixed

PR fix notes

PR #27014: build: bump NextJS from 15 to 16 with turbopack enabled for web production build boost

Description (problem / solution / changelog)

[!IMPORTANT]

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

<!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. -->
  • to close #27013

  • 3x faster improvement in web production build performance with Turbopack enabled, which has been stable for production build

    • (before) Next.js 15.5.4 without Turbopack: 73 sec
    • (after) Next.js 16.1.4 with Turbopack enabled: 17sec (cold run)
    • 4.39x faster in production build time
  • changes applied

    • changes from codemod run:
      • bumped React from 19.1 to 19.2
      • renamed middleware.js to proxy.ts
    • manual changes:
  • Result: The end-to-end build time for production is now 3x faster

    • build machine: MacBook Pro 2024 with M4 Max chip
    • 15.5.9 (without turbopack ): 73s
Wed Jan 21 11:25:49 CST 2026

> [email protected] build /Users/bw/dev/dify/web
> next build

   ▲ Next.js 15.5.9

   Creating an optimized production build ...
 ✓ Compiled successfully in 55s
   Skipping validation of types
   Skipping linting
 ✓ Collecting page data    
 ⚠ (serwist) 1241 precache entries (39629.00 KiB)
⚠ warnings
  public/vs/language/typescript/tsWorker.js is 5.75 MB, and won't be precached. Configure maximumFileSizeToCacheInBytes to change this limit.
  public/vs/editor/editor.main.js is 3.77 MB, and won't be precached. Configure maximumFileSizeToCacheInBytes to change this limit.

 ✓ Generating static pages (36/36)
 ✓ Collecting build traces    
 ✓ Finalizing page optimization    

...

ƒ Middleware                                               34.1 kB

●  (SSG)      prerendered as static HTML (uses generateStaticParams)
ƒ  (Dynamic)  server-rendered on demand

Wed Jan 21 11:27:04 CST 2026
  • 16.1.4 (with turbopack enabled ): 17s
Wed Jan 21 12:06:15 CST 2026

> [email protected] build /Users/bw/dev/dify/web
> next build

▲ Next.js 16.1.4 (Turbopack)

  Creating an optimized production build ...
✓ Compiled successfully in 13.4s
  Skipping validation of types
✓ Collecting page data using 15 workers in 815.2ms    
⚠ (serwist) 1414 precache entries (56475.62 KiB)
⚠ warnings
  public/vs/language/typescript/tsWorker.js is 5.75 MB, and won't be precached. Configure maximumFileSizeToCacheInBytes to change this limit.                                                                          
  public/vs/editor/editor.main.js is 3.77 MB, and won't be precached. Configure maximumFileSizeToCacheInBytes to change this limit.                                                                                    
                                                                                                                                                                                                                       
✓ Generating static pages using 15 workers (35/35) in 876.4ms
✓ Finalizing page optimization in 317.5ms    

...


ƒ Proxy (Middleware)

●  (SSG)      prerendered as static HTML (uses generateStaticParams)
ƒ  (Dynamic)  server-rendered on demand

Wed Jan 21 12:06:32 CST 2026

Screenshots

Production build time on M4 Max chip:

BeforeAfter
15.5.9 (without turbopack ): 573s16.1.4 (with turbopack enabled ): 17s

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

Changed files

  • web/app/components/base/ga/index.tsx (modified, +2/-3)
  • web/next.config.js (modified, +1/-7)
  • web/package.json (modified, +5/-5)
  • web/pnpm-lock.yaml (modified, +104/-143)
  • web/proxy.ts (renamed, +2/-1)
  • web/tailwind-common-config.ts (modified, +3/-2)
  • web/tailwind.config.js (modified, +1/-1)
  • web/tsconfig.json (modified, +2/-2)

PR #90046: Turbopack: allow resolving TS files in tailwind config

Description (problem / solution / changelog)

A regression from https://github.com/vercel/next.js/issues/86576

Closes https://github.com/vercel/next.js/issues/87898 Closes PACK-6421

Changed files

  • crates/next-api/src/next_server_nft.rs (modified, +1/-0)
  • test/e2e/app-dir/tailwind-css/my-plugin.ts (added, +0/-0)
  • test/e2e/app-dir/tailwind-css/tailwind-css.test.ts (modified, +3/-0)
  • test/e2e/app-dir/tailwind-css/tailwind.config.js (modified, +7/-0)
  • turbopack/crates/turbopack-resolve/src/resolve_options_context.rs (modified, +3/-0)
  • turbopack/crates/turbopack/src/evaluate_context.rs (modified, +1/-0)
  • turbopack/crates/turbopack/src/lib.rs (modified, +8/-1)

Code Example

./tailwind.config.ts:2:1
Module not found: Can't resolve './src/lib/tailwind'
  1 | import type { Config } from "tailwindcss";
> 2 | import { someCustomPlugin } from "./src/lib/tailwind";
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  3 |
  4 | export default {
  5 |   content: ["./src/**/*.{ts,tsx}"],

---

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6000
  Available memory (MB): 16384
  Available CPU cores: 10
Binaries:
  Node: 20.10.0
  npm: 10.2.3
  Yarn: N/A
  pnpm: 9.15.9
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
Next.js Config:
  output: N/A
RAW_BUFFERClick to expand / collapse

Hello! I have some custom Tailwind v3 plugins that I import in my tailwind.config.ts file. After upgrading to version 16.1, I began encountering Module not found errors. I have created a reproduction below.

Link to the code that reproduces this issue

https://github.com/carloitaben/test-repro-next-16-tw

To Reproduce

  1. pnpm i
  2. pnpm dev
  3. Open http://localhost:3000

Current vs. Expected behavior

With Next.js 16.1.1:

⚠ ./tailwind.config.ts:2:1
Module not found: Can't resolve './src/lib/tailwind'
  1 | import type { Config } from "tailwindcss";
> 2 | import { someCustomPlugin } from "./src/lib/tailwind";
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  3 |
  4 | export default {
  5 |   content: ["./src/**/*.{ts,tsx}"],
<img width="723" height="914" alt="Image" src="https://github.com/user-attachments/assets/36c8bb09-7659-4919-b670-a4cff63e3256" />

Downgrading to 16.0.10 or adding the --webpack flag removes the errors: <img width="723" height="914" alt="Image" src="https://github.com/user-attachments/assets/19588228-3ee7-4057-a770-ee0d20515fd5" />

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6000
  Available memory (MB): 16384
  Available CPU cores: 10
Binaries:
  Node: 20.10.0
  npm: 10.2.3
  Yarn: N/A
  pnpm: 9.15.9
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
Next.js Config:
  output: N/A

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

Turbopack

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

next dev (local)

Additional context

The error does not seem to break the build, and the code continues to function. I believe this is a Turbopack issue introduced in this minor version as running the scripts with the --webpack flags removes the error.

I've also tested this on the latest canary version (currently 16.1.1-canary.8), which exhibits the same behavior.

extent analysis

TL;DR

  • Running Next.js with the --webpack flag may temporarily resolve the Module not found errors encountered after upgrading to version 16.1.

Guidance

  • Verify that the issue is indeed related to Turbopack by checking if the error persists when using the --webpack flag.
  • Test downgrading to Next.js version 16.0.10 to confirm if the issue is specific to version 16.1.
  • Check the tailwind.config.ts file for any potential issues with the custom plugin imports.
  • Consider reporting the issue to the Next.js or Turbopack maintainers, as it may be a bug introduced in version 16.1.

Notes

  • The error does not seem to break the build, and the code continues to function, which suggests that this may be a warning or a non-critical issue.
  • The fact that running with the --webpack flag removes the error implies that the issue may be specific to Turbopack.

Recommendation

  • Apply workaround: Run Next.js with the --webpack flag until a fix is available, as it seems to resolve the Module not found errors.

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

nextjs - ✅(Solved) Fix Tailwind config throws `Module not found` on Next.js 16.1.1 (works on 16.0) [2 pull requests, 5 comments, 6 participants]