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

bug: useParams return type of RouteLiteral is being resolved as any #202

Closed
aqos156 opened this issue Oct 7, 2024 · 1 comment
Closed

Comments

@aqos156
Copy link

aqos156 commented Oct 7, 2024

Describe the bug
When usePathname is used within the codebase the return type RouteLiteral is being resolved to any.

image

However, everywhere else (that I have checked) the RouteLiteral is being resolved correctly.

image

Workaround

I have disabled generating types in production builds and manually removed the usePathname type override from nextjs-routes.d.ts.

Context (please complete the following information):

  • nextjs-routes version: 2.2.2
  • Are you using the pages directory, app directory ,or both?
  • Are you using nextjs-routes via next.config.js or the CLI (npx nextjs-routes)?
  • nextjs version: 14.2.14
tatethurston added a commit that referenced this issue Oct 8, 2024
@tatethurston
Copy link
Owner

@aqos156 Thanks for reporting this bug -- that was quite the oversight on my end. I've updated the specs to catch this and published v2.2.3 with the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants