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

Routes are broken when the page extension contains only 'tsx'. #65040

Closed
thecuvii opened this issue Apr 25, 2024 · 2 comments · Fixed by #65105 · May be fixed by #65163
Closed

Routes are broken when the page extension contains only 'tsx'. #65040

thecuvii opened this issue Apr 25, 2024 · 2 comments · Fixed by #65105 · May be fixed by #65163
Labels
bug Issue was opened via the bug report template. linear: next Confirmed issue that is tracked by the Next.js team. Pages Router Related to Pages Router. Runtime Related to Node.js or Edge Runtime with Next.js.

Comments

@thecuvii
Copy link

thecuvii commented Apr 25, 2024

Link to the code that reproduces this issue

https://github.com/thecuvii/page-extensions-repro

To Reproduce

  1. Create a new TypeScript app.

  2. Set pageExtensions to ['tsx'] in next.config.js.

  3. Visiting localhost:3000 will result in an error page with the message: 'pageExtensions.map is not a function'.

CleanShot 2024-04-25 at 7 20 49@2x

  1. Set pageExtension to `['tsx', 'ts'] and the problem will be resolved.

Current vs. Expected behavior

The router works when the pageExtensions are set to ['tsx'].

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.4.0: Fri Mar 15 00:10:42 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6000
  Available memory (MB): 65536
  Available CPU cores: 10
Binaries:
  Node: 20.12.2
  npm: 10.5.0
  Yarn: N/A
  pnpm: 9.0.5
Relevant Packages:
  next: 14.2.3 // Latest available version is detected (14.2.3).
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.4.5
Next.js Config:
  output: N/A

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

Pages Router, Runtime

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

next dev (local)

Additional context

No response

NEXT-3244

@thecuvii thecuvii added the bug Issue was opened via the bug report template. label Apr 25, 2024
@github-actions github-actions bot added Pages Router Related to Pages Router. Runtime Related to Node.js or Edge Runtime with Next.js. labels Apr 25, 2024
@eps1lon
Copy link
Member

eps1lon commented Apr 25, 2024

@thecuvii Thanks for the report. Does this also reproduce on 14.2.2?

@thecuvii
Copy link
Author

@eps1lon Yep, and also 14.2.0 / 14.2.1

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. linear: next Confirmed issue that is tracked by the Next.js team. Pages Router Related to Pages Router. Runtime Related to Node.js or Edge Runtime with Next.js.
Projects
None yet
3 participants