nextjs - 💡(How to fix) Fix Turbopack production build generates chunk filenames with multiple dots that trigger WAF 403 responses

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…

Error Message

GET https://example.com/_next/static/chunks/0od.e4.nsryo4.js net::ERR_ABORTED 403 (Forbidden) ChunkLoadError: Failed to load chunk /_next/static/chunks/0od.e4.nsryo4.js from module 255759

Root Cause

This only affects production deployments behind a WAF/reverse proxy. Local development with next dev --turbopack works fine because files are served directly without proxy interception.

Fix Action

Fix / Workaround

Workaround: Removing --turbopack from the build command resolves the issue since webpack generates filenames without multiple dots.

Code Example

GET https://example.com/_next/static/chunks/0od.e4.nsryo4.js net::ERR_ABORTED 403 (Forbidden)
ChunkLoadError: Failed to load chunk /_next/static/chunks/0od.e4.nsryo4.js from module 255759

---

- Next.js: 16.2.6
- Node.js: 24.x
- Build command: `next build --turbopack`
- Output mode: `standalone`
- Deployment: Docker container behind a reverse proxy with standard security rules
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://turbopack-waf-repro-production.up.railway.app/

To Reproduce

<img width="2876" height="1065" alt="Image" src="https://github.com/user-attachments/assets/57c9d66a-a578-4a37-b775-157560389b87" />
  1. Create a Next.js 16 app
  2. Build with next build --turbopack
  3. Deploy behind a reverse proxy or WAF with standard security rules (e.g., ModSecurity, AWS WAF, Cloudflare, Azure Front Door)
  4. Load any page in the browser

Current vs. Expected behavior

Current: Turbopack generates chunk filenames with multiple dots, such as:

  • 0od.e4.nsryo4.js (3 dots)
  • 05i_ndlbxx.jt.js (2 dots)
  • 0n.64z2vyhogj.js (2 dots)

Filenames with 3+ dots (like 0od.e4.nsryo4.js) are interpreted by standard WAF rules as "multiple file extension" patterns (a common attack vector like shell.php.jpg) and are blocked with 403 Forbidden responses. This causes ChunkLoadError at runtime:

GET https://example.com/_next/static/chunks/0od.e4.nsryo4.js net::ERR_ABORTED 403 (Forbidden)
ChunkLoadError: Failed to load chunk /_next/static/chunks/0od.e4.nsryo4.js from module 255759

Expected: Chunk filenames should use URL-safe, WAF-friendly patterns that do not contain multiple dots before the .js extension. Webpack-based builds (next build without --turbopack) generate names like chunks/framework-abc123.js which do not trigger these rules.

Provide environment information

- Next.js: 16.2.6
- Node.js: 24.x
- Build command: `next build --turbopack`
- Output mode: `standalone`
- Deployment: Docker container behind a reverse proxy with standard security rules

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

Webpack, Turbopack

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

Other (Deployed)

Additional context

Additional context

Verification: We tested all chunks referenced in our page HTML:

  • Chunks with 1-2 dots → 200 OK
  • Chunk with 3 dots (0od.e4.nsryo4.js) → 403 Forbidden

This only affects production deployments behind a WAF/reverse proxy. Local development with next dev --turbopack works fine because files are served directly without proxy interception.

Workaround: Removing --turbopack from the build command resolves the issue since webpack generates filenames without multiple dots.

Suggested fix: The Turbopack chunk naming algorithm should avoid generating filenames with more than one dot before the file extension (i.e., max pattern: chunkname.js, not chunk.name.hash.js). Alternatively, use hyphens or underscores instead of dots as separators in chunk IDs.

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 - 💡(How to fix) Fix Turbopack production build generates chunk filenames with multiple dots that trigger WAF 403 responses