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

Error: [route-node][buildPath] '{routeName}' is not defined #457

Open
lance-swoop opened this issue Mar 11, 2020 · 2 comments
Open

Error: [route-node][buildPath] '{routeName}' is not defined #457

lance-swoop opened this issue Mar 11, 2020 · 2 comments

Comments

@lance-swoop
Copy link

lance-swoop commented Mar 11, 2020

Getting Error: [route-node][buildPath] '{routeName}' is not defined on upgrade to 8.0.0, even though my router looks like this:

<RouterProvider router={createRouter([
  { name: 'href', path: '/href' },
  { name: 'typehref', path: '/type/href' },
  { name: 'foo/href', path: '/foo/href' },
  { name: 'bar/href', path: '/bar/href' },
])}>
  ...stuff...
</RouterProvider>

What do I need to do to fix?

     Error: [route-node][buildPath] '{routeName}' is not defined
        at RouteNode.buildPath (/Users/me/dev/foo/node_modules/route-node/src/RouteNode.ts:203:13)
        at Object.router.buildPath (/Users/me/dev/foo/node_modules/router5/dist/index.js:138:36)
        at BaseLink.Object.<anonymous>.BaseLink.buildUrl (/Users/me/dev/foo/node_modules/react-router5/dist/index.js:123:28)
        at BaseLink.Object.<anonymous>.BaseLink.render (/Users/me/dev/foo/node_modules/react-router5/dist/index.js:156:25)
@lid2000
Copy link

lid2000 commented Apr 28, 2020

I had this same problem and it took me a while to get to the bottom of it because I thought the problem was with my route definition as well, but was happened for me was one of my routes was rendering a component that contained a <Link> component, and the <Link> had an invalid routeName parameter set (I had a route called "analysis.videos" but the <Link> routeName was going to "analysis.video"). Previous versions didn't seem to throw an exception but v8 does.

@ivansergeev
Copy link

I have consistently 5-10% of users have met this problem. I do not know how to fix it, because all the routes are correct.

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

3 participants