Open yanni-fe opened 2 months ago
https://github.com/yanni-fe/nextjs-reproduce-demo
pages |- demo |- [[...slug]].tsx
// next.config.js const nextConfig = { assetPrefix: '/demo', }
open localhost:3000/demo will return 404
localhost:3000/demo
For versions before 14.2, it works well. After updating next.js to 14.2.3, it fails.
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 22.5.0 Binaries: Node: 18.17 npm: 9.8.1 Yarn: 1.22.19 Relevant Packages: next: 14.2.3 eslint-config-next: 14.2.3 react: 18.3.1 react-dom: 18.3.1 typescript: 5.1.3 Next.js Config: output: N/A
Pages Router
next dev (local), next start (local)
I think this is caused by this commit https://github.com/vercel/next.js/commit/4efe14238b5ab11935e73aa09631ef5ec8045b13
changes in packages/next/src/server/lib/router-utils/filesystem.ts at line 438
Either this should be fixed or documentation updated that you can't have same routes as assetPrefix
Link to the code that reproduces this issue
https://github.com/yanni-fe/nextjs-reproduce-demo
To Reproduce
open
localhost:3000/demo
will return 404Current vs. Expected behavior
For versions before 14.2, it works well. After updating next.js to 14.2.3, it fails.
Provide environment information
Which area(s) are affected? (Select all that apply)
Pages Router
Which stage(s) are affected? (Select all that apply)
next dev (local), next start (local)
Additional context
I think this is caused by this commit https://github.com/vercel/next.js/commit/4efe14238b5ab11935e73aa09631ef5ec8045b13
changes in packages/next/src/server/lib/router-utils/filesystem.ts at line 438