Closed QuentinDutot closed 3 weeks ago
It looks like you are getting the client version of router on the server. I'm not sure of your build process but you want to make sure the "solid" export condition is set so that it pulls in source and builds it correctly per environment. Like Vue or Svelte we don't tend to precompile libraries since there can be multiple outputs from the templating. We do precompile a build with the router to support no build environments but the combinatorics start getting prohibitive in other (SSR) scenarios.
I'm going to close the issue as it doesn't appear to be a router bug, but et me know if you need additional help setting this up.
Describe the bug
I'm doing SSR with hono, I use both renderToStringAsync from solid-js/web and Router from @solidjs/router in the pages I want to render on the server. I get following errors:
The hack I use is to replace
import { Router } from '@solid-js/router'
withimport { Router } from './node_modules/@solidjs/router/dist/index.jsx'
And so for every imports from @solidjs/router or to create a file that imports everything from node_modules and re-exports it.
Your Example Website or App
^
Steps to Reproduce the Bug or Issue
^
Expected behavior
^
Screenshots or Videos
No response
Platform
Additional context
No response