Skip to content

Wrapper doesn't support Next 14 #564

@jarriaza-102

Description

@jarriaza-102

Describe the bug

useRouter hook gotten from next/router is throwing errors while working with Next 14, development server is going alright, it's just whenever build process take place and run the built version of the code.

This file in next-redux-wrapper is using next/router, and that's outdated for Next 14.
There's a file on Next 14 that is throwing an error when router doesn't exist, and the router gotten from next/router is the guilty of that, there should be a migration to next/navigation.

To Reproduce

Update to Next 14 and wrap component with reduxWrapper.withRedux.

Expected behavior

Wrapper should run with Next 14, I think problem is also on Next >= 13.5

Desktop (please complete the following information):

  • OS: Mac OS 14.0
  • Browser Console
  • Version 8.1.0

Additional context

I did a change in my node_modules folder removing the code that is using useRouter from next/router, and it works just fine!
Also there's no way to use redux-wrapper with generateStaticParams.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions