-
Notifications
You must be signed in to change notification settings - Fork 30k
Closed
Labels
linear: nextConfirmed issue that is tracked by the Next.js team.Confirmed issue that is tracked by the Next.js team.locked
Description
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/ws2m7y
To Reproduce
- Start the custom server in development mode with
node server.mjs - Navigate to
/api/helloin the browser
The response will fail and the console will show this error:
⨯ [TypeError: Cannot set property query of #<IncomingMessage> which has only a getter] {
page: '/api/hello'
}
Current vs. Expected behavior
I had no trouble using Express 4 as a custom server in front of Next.js. But when I tried to upgrade to Express 5, I started seeing this error when trying to access any API endpoint in the Pages Router. Pages still load fine.
Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: #1 SMP PREEMPT_DYNAMIC Sun Aug 6 20:05:33 UTC 2023
Available memory (MB): 4242
Available CPU cores: 2
Binaries:
Node: 20.12.0
npm: 10.5.0
Yarn: 1.22.19
pnpm: 8.15.6
Relevant Packages:
next: 15.2.0 // There is a newer version (15.3.2) available, upgrade recommended!
eslint-config-next: 15.2.0
react: 19.0.0
react-dom: 19.0.0
typescript: 5.7.2
Next.js Config:
output: N/AWhich area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
I was able to reproduce the same error in 14.2.26. My guess would be that Next.js has always had a compatibility issue with Express 5, though if that's the case then I'm surprised I haven't seen more reports of this issue.
rafaelbeckel, Sealos, rvetere, sanghin, rachel-bernard and 16 more
Metadata
Metadata
Assignees
Labels
linear: nextConfirmed issue that is tracked by the Next.js team.Confirmed issue that is tracked by the Next.js team.locked