molefrog / wouter

🥢 A minimalist-friendly ~2.1KB routing for React and Preact
https://npm.im/wouter
The Unlicense
6.65k stars 152 forks source link

(?) Hash routing with no prefix slash index.html#/example/path/ #397

Closed markamber closed 9 months ago

markamber commented 9 months ago

I am in a file:// context, using vite to wrap all this up. I am able to get my use case working now with memory router but it is obviously not ideal.

Is this possible now? Is it a bug? a feature request?

On 3.0.0-rc2

molefrog commented 9 months ago

Hi @markamber, could you clarify? What does the URL in the address bar look like?

markamber commented 9 months ago

Thanks for the quick response. Sorry I didn't get back quite as soon.

Here's what happens... also this might not be a bug or feature request just bear with me and keep in mind I'm using vite in case that does any redirecting nonsense.

What is happening:

  1. Go to file://C:/folder/index.html
  2. I see my UI for 50 milliseconds
  3. Immediately browser navigate to file://C:/folder/index.html/#
  4. White screen of death

What I need:

  1. Go to file://C:/folder/index.html (the initial page loads
  2. Click on link
  3. No browser navigate, but url bar shows file://C:/folder/index.html#linkroute
molefrog commented 9 months ago

Hey @markamber, I am pretty sure that pushState navigation doesn't work in a file:// context. I would recommend using a simple local webserver to test this: npx serve. Please let me know if this helps.