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

Sourcemaps are not loaded in index pages with a dynamic route level deeper than one #66072

Open
albertodeago opened this issue May 22, 2024 · 0 comments
Labels
bug Issue was opened via the bug report template.

Comments

@albertodeago
Copy link

Link to the code that reproduces this issue

https://github.com/albertodeago/next-sourcemaps-repro

To Reproduce

Steps described also in the readme of the reproduction repo

Clone the reproduction repo and:

npm install
npm run build
npm run start

Open the app in the browser (localhost:3000), open the devtools and navigate through the pages.
Open (in the source panel) the sourcemaps relative to the /content/[subject]/[method]/index.page.tsx page, you will see that the sourcemaps are not there (chrome will show a 404 error).

image

The chunk is actually generated by next build but seems like it's not picked up by the server (my guess)

This happens to all the index.page.tsx pages with a dynamic route ([whatever]) with a level deeper than 1 (so /content/[subject]/index.page.tsx has the sourcemaps visible in the browser).

Note that it doesn't happen in a page that has a name different than index (e.g. /content/[subject]/[method]/named.page.tsx)

Current vs. Expected behavior

Current behaviour

sourcemaps on index pages with a dynamic route level deeper than 1 are not loaded

Expected behaviour

Any page sourcemap should be loaded in the browser

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.5.0: Wed May  1 20:14:38 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6020
  Available memory (MB): 16384
  Available CPU cores: 12
Binaries:
  Node: 20.8.0
  npm: 10.1.0
  Yarn: 1.22.21
  pnpm: 8.8.0
Relevant Packages:
  next: 14.2.3 // Latest available version is detected (14.2.3).
  eslint-config-next: N/A
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.4.5
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Not sure

Which stage(s) are affected? (Select all that apply)

next build (local), next start (local)

Additional context

  • I tested this in multiple browsers (safari, chrome and firefox (all latest versions))

  • Tried with both pageExtensions and without it and seems to affect both

  • I did not test it with app router because this affect an application I'm working on that cannot migrate to app router yet

  • The bug seems to affect only index pages (not pages with a different name), as it's described in the reproduction repo

@albertodeago albertodeago added the bug Issue was opened via the bug report template. label May 22, 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.
Projects
None yet
Development

No branches or pull requests

1 participant