Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assetPrefix with same name of route with catch-all segments won't work since 14.2 (Using Page Router) #65639

Open
yanni-fe opened this issue May 11, 2024 · 0 comments
Labels
bug Issue was opened via the bug report template. Pages Router Related to Pages Router.

Comments

@yanni-fe
Copy link

yanni-fe commented May 11, 2024

Link to the code that reproduces this issue

https://github.com/yanni-fe/nextjs-reproduce-demo

To Reproduce

  1. Create a next.js project
  2. Create a test route with catch-all segments
 pages
    |- demo
        |- [[...slug]].tsx
  1. add assetPrefix with same name of route
// next.config.js
const nextConfig = {
    assetPrefix: '/demo',
}

open localhost:3000/demo will return 404

Current vs. Expected behavior

For versions before 14.2, it works well. After updating next.js to 14.2.3, it fails.

Provide environment information

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

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 4efe142

changes in packages/next/src/server/lib/router-utils/filesystem.ts at line 438

@yanni-fe yanni-fe added the bug Issue was opened via the bug report template. label May 11, 2024
@github-actions github-actions bot added the Pages Router Related to Pages Router. label May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. Pages Router Related to Pages Router.
Projects
None yet
Development

No branches or pull requests

1 participant