vercel / next.js

The React Framework
https://nextjs.org
MIT License
126.85k stars 26.97k forks source link

Incorrect js chunk URL in production when path is `/[param]/+` #50742

Open Zertz opened 1 year ago

Zertz commented 1 year ago

Verify canary release

Provide environment information

Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 22.5.0: Mon Apr 24 20:52:24 PDT 2023; root:xnu-8796.121.2~5/RELEASE_ARM64_T6000
    Binaries:
      Node: 18.13.0
      npm: 8.19.3
      Yarn: 1.22.19
      pnpm: 8.6.0
    Relevant packages:
      next: 13.4.5-canary.4
      eslint-config-next: 13.4.4
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.1.3

Which area(s) of Next.js are affected? (leave empty if unsure)

App directory (appDir: true)

Link to the code that reproduces this issue or a replay of the bug

https://codesandbox.io/p/sandbox/github/vercel/next.js/tree/canary/examples/reproduction-template-app-dir

To Reproduce

Describe the Bug

In production, request URL for the page bundle: /_next/static/chunks/app/%5Byyyymmdd%5D/+/page-92212aab0f714056.js

Actual URL: /_next/static/chunks/app/[yyyymmdd]/+/page-92212aab0f714056.js

Expected Behavior

It should work? Renaming the + directory to new fixes the issue.

Which browser are you using? (if relevant)

Edge

How are you deploying your application? (if relevant)

Vercel

TKLeuPT commented 1 year ago

Hey, I am having the same issue. Did you find any fix or workaround for this?

Zertz commented 1 year ago

My workaround was to use a more traditional path but I haven't tried again with the latest version yet.

TKLeuPT commented 1 year ago

My path is very basic and still having issues aswell, I've tried upgrade and downgrade the versions and still have the problem.

In production: _next/static/chunks/app/artigos/%5Buid%5D/page-8171c833481412ca.js Actual URL: _next/static/chunks/app/artigos/[uid]/page-8171c833481412ca.js

The rest of the website works perfectly, its just when I enter any parameter on the uid place.

TKLeuPT commented 1 year ago

I've also had a problem with the API, not sure if it is related to the same thing.

I am hosting the app with a server.js file in a cPanel environment.

So I had to move the API endpoints to Express JS instead next as a workaround.

Not sure why this happened.

neilhem commented 1 year ago

Have you tried version 13.5.4? Looks like versions 13.5.5, 13.5.6 & 14.0.0 have this issue