- Notifications
You must be signed in to change notification settings - Fork30.1k
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: 8Binaries: Node: 22.14.0 npm: 11.4.2 Yarn: N/A pnpm: N/ARelevant Packages: next: 16.0.8 eslint-config-next: N/A react: 19.2.1 react-dom: 19.2.1 typescript: 5.9.3Next.js Config: output: standalone
Which 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