-
Notifications
You must be signed in to change notification settings - Fork 29
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
my push method from next/router not working properly as expected after wrapping my app with ConnectedRouter #62
Comments
Hi @Prof-isaac, I've tried recreating this on the latest version of the library and Next.js 10 and couldn't recreate. Can you create a small reproduction in codesandbox or in one of the library test cases? |
@danielr18 am using "next": "^9.5.5", "connected-next-router": "^3.1.0", but this works showing there is a poblem when i add pathname and query |
See #54. V3 is not compatible with Next.js 9.5, I would recommend updating to Next.js 10 and v4 of this library. |
@danielr18 just upgrade to v10 and v4 and i get this error next-dev.js:89 Error was not caught Error: No router instance found. I don't think both are backward compatible because if i go back to next 9.5 and connected-next-router v3 |
@Prof-isaac Can you share the full stack trace of the error? |
@danielr18 next-dev.js:89 Error was not caught Error: No router instance found.
|
Are you dispatching a navigation action server side? |
@danielr18 |
You can only use navigation actions or next/router methods client side, so make sure that you don't do it server side. You could use |
@danielr18 const navigateTo = ({ dispatch }) => next => action => { |
If you can create a small reproduction, I will be able to better help you. I would say UI_NAVIGATE action isn't needed, you could just dispatch connected-next-router actions where you dispatch those. |
@danielr18 const routerMiddleware = createRouterMiddleware(); const parseMiddleware = () => { if (process.env.NODE_ENV === "production") { const store = createStore( |
my app.js
push not working properly
router.push({
pathname:
home/${productName}/${id}/view
,query: { previousLabel }
})
Error from project
Unhandled Runtime Error
TypeError: url.startsWith is not a function
Source
next-server\lib\router\router.ts (97:6) @ isLocalURL
95 | */
96 | export function isLocalURL(url: string): boolean {
The text was updated successfully, but these errors were encountered: