Adding a middleware causes additional requests to /_next/data/**/*.json and their reponses are empty {}
.
#59295
Closed
1 task done
{}
.
#59295
Link to the code that reproduces this issue
https://github.com/inside/repro-next-data-empty-object
To Reproduce
npm install
npm run build
npm start
http://localhost:3000
_next/data
request for each link to a pageResponse
tab{}
Current vs. Expected behavior
BUG:
When a middleware is active like this one:
src/middleware.js
, additional requests are made with an empty response{}
.A request url example looks like this:
http://localhost:3000/_next/data/K-vmVE_c03yQwV9UdiOv2/page1.json
and its reponse is empty{}
.EXPECTED BEHAVIOR:
No additional request should be performed. This is the case if you deactivate the middleware.
Verify canary release
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #99~20.04.1-Ubuntu SMP Thu Nov 2 15:16:47 UTC 2023 Binaries: Node: 20.10.0 npm: 10.2.3 Yarn: 1.22.21 pnpm: 7.11.0 Relevant Packages: next: 14.0.4-canary.41 eslint-config-next: 13.5.6 react: 18.2.0 react-dom: 18.2.0 typescript: 5.3.2 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Middleware / Edge (API routes, runtime)
Additional context
If you access the url
http://localhost:3000/_next/data/K-vmVE_c03yQwV9UdiOv2/page1.json
directly in your browser, thepage1
will be displayed like if we are accessing this urlhttp://localhost:3000/page1
The text was updated successfully, but these errors were encountered: