Router isn't working.
Why routing is not working when i'm following exactly what doc says.
Doc: https://docs.solidjs.com/solid-router/getting-started/defining-routes
I'm getting the following error: 'index.tsx:5 Unrecognized value. Skipped inserting'
17 Replies
You're importing Home from "./HelloWorld"
But your Home file is Home.tsx as shown in the snippet
Try
Nah, i just wrote it wrong on discord, the files imports are correct.
for example, this does not work.
this does work.
Oh maybe because You have Route written like this
instead of
But not sure, It should work
Can you attach it to root Component and then render it that way?
yeah it should work, that's what is bothering me, it's a new project, i used the minimal template from 'solidjs/templates', added @solid/router, and that's it.
not, did not work.
The error was on which line exactly? Based on the screenshot
line 12, the render function
Ok in the index.html
Is the Element with the id of "root" or "app"
This is mine and the div has id of root
and you need to target the index.tsx in html file
i changed to app, but i dont think this is the problem, because if i pass the component directly, it does load, but it doesnt if i pass the router
Oh yeah thats true...
Hmm, looking at your project I don't see any node modules
The app shouldn't be running without node modules so you might have it installed but just incase in the terminal type
In /web directory
IDE automatically hides node_modules
i made it work using config, however what i truly want is do this using jsx syntax only.
Component is not being recognized.
Docs are pretty straight forward, (https://docs.solidjs.com/guides/routing-and-navigation), i can't grasp what is being done wrong here.
What does your home component look like
here, it's just a hello world
Could be because it doesn't have a name
note css is not imported in index.js