next.js
next.js copied to clipboard
output: 'export' does not create _next/data folders but static site still looks for data json files when middleware.ts is present
Link to the code that reproduces this issue
https://github.com/pr1ntr/next-json-bug-repro
To Reproduce
npm run build
npx serve out/
Current vs. Expected behavior
current behavior is tries to fetch _next/data/
Expected behavior is that it wont try to fetch _next/data/
Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 11 Pro
Binaries:
Node: 18.18.0
npm: N/A
Yarn: N/A
pnpm: 7.26.2
Relevant Packages:
next: 14.1.0
eslint-config-next: 14.1.0
react: 18.2.0
react-dom: 18.2.0
typescript: 5.3.3
Next.js Config:
output: export
Which area(s) are affected? (Select all that apply)
Middleware / Edge (API routes, runtime), Static HTML Export (output: "export")
Which stage(s) are affected? (Select all that apply)
next build (local), Other (Deployed)
Additional context
I tested this in 14.0.4 and 14.1, another person tested canary with similar results.
You may ask yourselves.. why do you have a middleware.ts file? Well because our prod/staging urls are in cloudfront/s3 but we still use vercel for previews.