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

With Next14, the path to the RouterContext seems to be wrong. #110

Open
highhi opened this issue Nov 9, 2023 · 2 comments
Open

With Next14, the path to the RouterContext seems to be wrong. #110

highhi opened this issue Nov 9, 2023 · 2 comments

Comments

@highhi
Copy link

highhi commented Nov 9, 2023

  • Next 14.0.1
  • Node 18.18.1
  • next-router-mock 0.9.10
Module not found: Error: Can't resolve 'next/dist/shared/lib/router-context' in './node_modules/next-router-mock/dist/MemoryRouterProvider'

Perhaps next/dist/shared/lib/router-context.shared-runtime is the expected path.

@scottrippey
Copy link
Owner

You're correct, every couple of versions of Next, they move this file path.
I'll add next 14 support very soon. PR's welcome if you want to get to it sooner!

@highhi
Copy link
Author

highhi commented Nov 13, 2023

Thanks!I fixed the following in my application and the error went resolved.

- import { MemoryRouterProvider } from 'next-router-mock/MemoryRouterProvider'
+ import { MemoryRouterProvider } from 'next-router-mock/MemoryRouterProvider/next-13.5'

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