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

typedRoutes don't recognize parameter on rewritten url if preceded by path character #66876

Open
tinleym opened this issue Jun 14, 2024 · 0 comments
Labels
bug Issue was opened via the bug report template. TypeScript Related to types with Next.js.

Comments

@tinleym
Copy link

tinleym commented Jun 14, 2024

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/elastic-lucy-jfpczm?file=%2F.next%2Ftypes%2Flink.d.ts

To Reproduce

The error is in the generated types file.

Current vs. Expected behavior

If rewriting /@:username to /user/:username, I'd expect a generated type like /@${SafeSlug<T>} but instead I get /@[username].

Provide environment information

Operating System:
  Platform: darwin
  Arch: x64
  Version: Darwin Kernel Version 21.6.0: Mon Feb 19 20:24:34 PST 2024; root:xnu-8020.240.18.707.4~1/RELEASE_X86_64
  Available memory (MB): 16384
  Available CPU cores: 8
Binaries:
  Node: 22.2.0
  npm: 10.7.0
  Yarn: N/A
  pnpm: 7.33.7
Relevant Packages:
  next: 14.2.0 // There is a newer version (14.2.4) available, upgrade recommended! 
  eslint-config-next: 14.2.0
  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)

TypeScript

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

next dev (local)

Additional context

No response

@tinleym tinleym added the bug Issue was opened via the bug report template. label Jun 14, 2024
@github-actions github-actions bot added the TypeScript Related to types with Next.js. label Jun 14, 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. TypeScript Related to types with Next.js.
Projects
None yet
Development

No branches or pull requests

1 participant