solid-start: [Bug?]: Router "base" property is flaky
UPDATE (moving focus from base prop in vite.config to base prop on Router): For repro instructions, see https://github.com/solidjs/solid-start/issues/1158#issuecomment-1867734373
Duplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Current behavior π―
Currently the /_build is the default base path:
Expected behavior π€
I expected either / or ββ to be the default base path unless set otherwise. If i set it to these values, my routes return nothing.
Steps to reproduce πΉ
- npm create solid.
- choose
baretemplate
set the vite config to:
export default defineConfig({
base: "/test/"
});
- launch the dev server and go to `http://localhost:3000/test/
- result is that page isnβt found, and that itβs still only on http://localhost:3000
Context π¦
Iβm making a SSG docs site, on a subpath like this example.com/subpath/routes and thus need to set the base to /subpath/
this is to some extend a remake of the now obsolete
Your environment π
@solidjs/start 0.4
@solidjs/router 0.10
macos - arm64
chrome 120
About this issue
- Original URL
- State: closed
- Created 6 months ago
- Comments: 17 (16 by maintainers)
Commits related to this issue
- (feat): deep support for `server.baseURL` API from nitro in dev & prod, fixes [Bug?]: Router "base" property is flaky solidjs/solid-start#1158 #55 — committed to nksaraf/vinxi by nksaraf 6 months ago
Could you try
vinxi@0.0.55. This should be fixed in that. Passingserver.baseURLshould give you the correct url inimport.meta.env.SERVER_BASE_URL. And your entire app will be served atserver.baseURL.I think some issues with the
basebeing used properly across the system still need things fixed in solid-start and vinxi, so better to keep this open.