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:

https://github.com/solidjs/solid-start/blob/cfe17fa2da37726ef59be347efbef4d8274b74aa/packages/start/config/index.js#L156

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 bare template

set the vite config to:

export default defineConfig({
  base: "/test/"
});

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

Most upvoted comments

Could you try vinxi@0.0.55. This should be fixed in that. Passing server.baseURL should give you the correct url in import.meta.env.SERVER_BASE_URL. And your entire app will be served at server.baseURL.

I think some issues with the base being used properly across the system still need things fixed in solid-start and vinxi, so better to keep this open.