When I add a private route to routes.js in my repo, my app crashes with a couple errors.
index.js:1 Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Check the render method of `Routes`.
in Routes
in ApolloProvider (created by GraphQLProvider)
in GraphQLProvider (created by RedwoodProvider)
in RedwoodProvider
in AuthProvider
in FatalErrorBoundary
console.<computed> @ index.js:1
named-routes.js:27 Uncaught TypeError: Cannot read property 'startsWith' of undefined
at push.../node_modules/core-js-pure/es/instance/starts-with.js.module.exports (starts-with.js:6)
Hey @tonyjmartinez, I'll pull this down and take a look right now, but it looks like your router is still on v0.6.0, along with a few other packages:
"dependencies": {
"@redwoodjs/auth": "^0.7.0",
"@redwoodjs/router": "^0.6.0",
"@redwoodjs/web": "^0.6.0",
...
}
And private routes are a new feature that were introduced at the same time as auth (I think). Maybe upgrading would fix this? This command should do all the heavy-lifting for you:
yarn rw upgrade
That would definitely cause this issue, thanks for debugging @jtoar
Most helpful comment
Hey @tonyjmartinez, I'll pull this down and take a look right now, but it looks like your router is still on v0.6.0, along with a few other packages:
And private routes are a new feature that were introduced at the same time as auth (I think). Maybe upgrading would fix this? This command should do all the heavy-lifting for you: