-
Notifications
You must be signed in to change notification settings - Fork 373
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
[Bug]: Solid-Start should not reuse Vite's "base" setting for the router #1132
Comments
my temporary local solution is this YARN patch: diff --git a/entry-client/StartClient.tsx b/entry-client/StartClient.tsx
index a9b6ecb4bdb13d07ceae0d1246745ee527638b4f..e8d551f9b6e5609f3c20d830dafd9a4af99655a0 100644
--- a/entry-client/StartClient.tsx
+++ b/entry-client/StartClient.tsx
@@ -95,7 +95,7 @@ export default ({
);
}
- const BASE_URL = import.meta.env.BASE_URL;
+ const BASE_URL = "/";
let basePath = BASE_URL;
if (BASE_URL.startsWith("http")) {
try { |
100% agree with you here. That would be the correct fix I maybe should have done originally. I suppose since SolidStart is still in beta, it's no problem to just make the change. But even if we wanted to avoid breaking apps, we could have a behavior like so: if NEW_SOLIDSTART_BASE_PATH is defined, use that for routing instead of vites BASE |
Part of the solution here in SolidStart beta 2 is putting the router outside of Start so you always configure the base path yourself. But yeah this came as a result of a PR so clearly people expected this behavior. I'm debating how to handle it as I'm sort of at a stage where I'm not trying to do breaking changes in the current beta. And this is fixed in the next version. |
oh… right. @ryansolid I just figured out that it is possible to do several simple things:
I can build this patch a bit later if it sounds right |
@indeyets are you able to use beta v2? |
I didn't have time to look at it from practical PoV. I really should. I expect middlewares will break (and I have 4 or 5 of those) |
In setting up for SolidStart's next Beta Phase built on Nitro and Vinxi we are closing all PRs/Issues that will not be merged due to the system changing. If you feel your issue was closed by mistake. Feel free to re-open it after updating/testing against 0.4.x release. Thank you for your patience. See #1139 for more details. |
Duplicates
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):
https://cdn.example.com/custom/path
https://app.example.com/
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/
andbase=/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
The text was updated successfully, but these errors were encountered: