-
Notifications
You must be signed in to change notification settings - Fork 408
Description
Duplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Current behavior 😯
Vite's "base" setting, which is originally intended as the base-url for assets is reused for solid-router here: https://github.com/solidjs/solid-start/blame/main/packages/start/entry-client/StartClient.tsx#L98
current behaviour is originally defined by @atk and then fine-tuned by @devinrhode2
Expected behavior 🤔
Solid-Start should provide a separate independent setting for router's base-path to support cases when assets are served from one path, but actual app is served from another.
Steps to reproduce 🕹
Steps (sorry, its "fake" data, as I don't know how to make real-life reproduction for this):
- Set "base" setting in "vite.config.ts" to
https://cdn.example.com/custom/path - Deploy app to
https://app.example.com/ - Open the page
- See that all of dynamic JS-based elements defined "inside" of router are NOT dynamic (hydration didn't run)
Context 🔦
My situation looks like this:
We serve assets (js, css, … files) from the CDN and use both custom host and custom path-prefix there. Vite's "base" setting is perfect for configuring this.
So, for example, it looks like: https://cdn.example.com/custom/path
Solid start reads this setting and reuses the path for the base setting of solid-router.
But the problem is, that the app is served from: https://app.example.com/ and base=/custom/path SILENTLY breaks the routing and while server-side renders the pages, client-side doesn't even try to hydrate them. No error or warning here.
Your environment 🌎
No response