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

Cannot find module next/navigation (nuqs 2.0.0) #693

Closed
tiagoskaneta opened this issue Oct 22, 2024 · 5 comments · Fixed by #694
Closed

Cannot find module next/navigation (nuqs 2.0.0) #693

tiagoskaneta opened this issue Oct 22, 2024 · 5 comments · Fixed by #694
Labels
bug Something isn't working released

Comments

@tiagoskaneta
Copy link

Context

What's your version of nuqs?

"nuqs": "^2.0.0",

What framework are you using?

  • ✅ Next.js (pages router)

Which version of your framework are you using?

next: 15.0.0

Description

Getting the following after installing [email protected] in a next.js 15 project:

Error: Cannot find module '/.../my-app/node_modules/next/navigation' imported from /.../my-app/node_modules/nuqs/dist/chunk-YYVIPTKH.js
Did you mean to import next/navigation.js?

Also occurs on a project created from scratch.

Reproduction

  1. Create new Next.js (15) project with Pages router
  2. Install [email protected]
  3. Add Pages adapter
  4. npm run dev
@tiagoskaneta tiagoskaneta added the bug Something isn't working label Oct 22, 2024
@franky47
Copy link
Member

Ah, it looks like it's the ghost of #368 coming back to haunt us on Halloween. Let me see if I can reproduce it on my end.

In the mean time, does it work if you edit node_modules/nuqs/dist/chunk-YYVIPTKH.js to add the .js extension to the next/navigation import? (don't forget to remove the .next directory to clear the cache)

@franky47
Copy link
Member

Can you try this version and see if it works for you?

pnpm add https://pkg.pr.new/nuqs@694

@tiagoskaneta
Copy link
Author

tiagoskaneta commented Oct 22, 2024

Can you try this version and see if it works for you?

pnpm add https://pkg.pr.new/nuqs@694

@franky47 thanks for the prompt answer. Yup, that seems to work just fine.

And for the record, yes, manually editing node_modules/nuqs/dist/chunk-YYVIPTKH.js also fixed the issue.

Copy link

🎉 This issue has been resolved in version 2.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@tiagoskaneta
Copy link
Author

@franky47 working fine now, thanks for the release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants