-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Open
Copy link
Labels
OutputRelated to the the output configuration option.Related to the the output configuration option.Pages RouterRelated to Pages Router.Related to Pages Router.WebpackRelated to Webpack with Next.js.Related to Webpack with Next.js.
Description
Link to the code that reproduces this issue
https://github.com/TheDanniCraft/clipify
To Reproduce
- Start the server in dev mode
- the URL
/js/script.file-downloads.hash.outbound-links.tagged-events.jsis correctly proxied tohttps://analytics.thedannicraft.de//js/script.file-downloads.hash.outbound-links.tagged-events.js - Build (
next build --webpack) - Start (
next start) - On prod build
/js/script.file-downloads.hash.outbound-links.tagged-events.jsreturnsHTTP 500 Internal Server Error
Current vs. Expected behavior
Expected behavior (worked in next v15 before upgrading to next v16)
The rewrite should behave the same way in production as in development and proxy the file to:
https://analytics.thedannicraft.de//js/script.file-downloads.hash.outbound-links.tagged-events.js
Actual behavior:
Dev mode: Works as expected
Production build: Returns 500
I also verified the rewrite exists at build time by logging (when next config is parsed):
const rewrites = await config.rewrites();
console.log(rewrites.find(r => r.source === "/js/script.file-downloads.hash.outbound-links.tagged-events.js"));
Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Pro
Available memory (MB): 8035
Available CPU cores: 8
Binaries:
Node: 22.14.0
npm: 11.4.2
Yarn: N/A
pnpm: N/A
Relevant Packages:
next: 16.0.8
eslint-config-next: N/A
react: 19.2.1
react-dom: 19.2.1
typescript: 5.9.3
Next.js Config:
output: standaloneWhich area(s) are affected? (Select all that apply)
Webpack, Output, Pages Router
Which stage(s) are affected? (Select all that apply)
next build (local), next start (local)
Additional context
No response
Metadata
Metadata
Assignees
Labels
OutputRelated to the the output configuration option.Related to the the output configuration option.Pages RouterRelated to Pages Router.Related to Pages Router.WebpackRelated to Webpack with Next.js.Related to Webpack with Next.js.