-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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] - path is undefined when using NextUIProvider and useRouter in React component #2930
Comments
I think this issue is related to the update of the This diff is included in the latest version of the |
I was using 3.24.0 but still didn't see the issue. please provide a stackblitz link for us to investigate. |
I also encountered this error, but I'm still looking into how to reproduce it. It seems that the error was triggered when I added a new nextui package (the accordion one). When I removed the router from NextUIProvider, everything worked ok. |
These are my current dependencies and everything works ok when passing router to NextUIProvider. If I update for example
|
The error can be reproduced here: https://stackblitz.com/edit/stackblitz-starters-dkwe9f?file=README.md |
The fix will be available in the next release. At the same time, you can use our canary version as a workaround if necessary. "@nextui-org/system": "0.0.0-canary-20240504162810" update import { NextUIProvider } from "@nextui-org/system"; |
Is the fix released in 2.4? Path is still undefined in NextUIProvider navigate argument after upgrading |
@hkmute please remove your node_modules, and reinstall 2.4.1. If it still fails, please share a stackblitz project. |
@wingkwong https://stackblitz.com/~/github.com/hkmute/remix-nextui?file=app/root.tsx |
@hkmute after digging a bit, i could see this issue only when I use npm. it works fine with pnpm. |
NextUI Version
2.3.6
Describe the bug
The bug causes a "TypeError: path is undefined" when using NextUIProvider and useRouter in a React component.
Your Example Website or App
No response
Steps to Reproduce the Bug or Issue
1- Import NextUIProvider and useRouter.
2- Define a React functional component named Providers, accepting children as props.
3 - Within Providers component, initialize useRouter hook to get the router object.
4 - Use NextUIProvider component, passing router.push method as navigate prop.
5 - Encounter "TypeError: path is undefined" error during execution.
Expected behavior
As a user, I expect that when using the NextUIProvider and useRouter within a React component, the application should function correctly without encountering any errors related to undefined paths.
Screenshots or Videos
Operating System Version
Ubuntu
Browser
Firefox
The text was updated successfully, but these errors were encountered: