solidjs / solid-router

A universal router for Solid inspired by Ember and React Router
MIT License
1.11k stars 138 forks source link

"base" property is flaky #334

Closed birkskyum closed 6 months ago

birkskyum commented 7 months ago

Describe the bug

moved from

In the basic template of solid-start I tried setting the base prop on the router to /offset:

<Router
  base="/offset"
  root={(props) => (
    <MetaProvider>
      <Title>SolidStart - Basic</Title>
      <A href="/">Index</A>
      <A href="/about">About</A>
      <Suspense>{props.children}</Suspense>
    </MetaProvider>
  )}
>

and then when i click the link to the /about page it does direct to /offset/about which is great, but I get a "Page not Found", and when I refresh on /offset/about it can find that page. ( note: I applied https://github.com/solidjs/solid-start/pull/1170 )

Expected behavior

expected the routes /offset/ and /offset/about to work every time.

Platform

Additional context

No response

femincan commented 7 months ago

I tested out your issue on a plain Solid.js app and a Solid Start app with your given example but couldn't reproduce it. Everything works as expected.

Could the problem be elsewhere in your app?

birkskyum commented 7 months ago

Very Interesting, thanks for testing it. I'll experiment a bit further then, and get a stackblitz up when it's possible again

ryansolid commented 6 months ago

@birkskyum any follow up on this issue?

birkskyum commented 6 months ago

This appear to be working now with these versions present in a new clone of the basic example:

  "dependencies": {
    "@solidjs/meta": "^0.29.2",
    "@solidjs/router": "^0.10.10",
    "@solidjs/start": "^0.4.11",
    "solid-js": "^1.8.12",
    "vinxi": "^0.1.10"
  },