oedotme / generouted

Generated file-based routes for Vite
https://stackblitz.com/github.com/oedotme/generouted/tree/main/explorer
MIT License
1.02k stars 47 forks source link

vite preview not finding routes #165

Closed waldo2810 closed 4 months ago

waldo2810 commented 4 months ago

Describe the Bug

Application throws the following error upon loading:

Unexpected Application Error!
404 Not Found

This not only happens when npm run build and then npm run preview in my computer. But also doing the same in a Dockerfile.

Generouted Version

1.18.2

Your Example Website or App or Reproduction

https://www.waasabi.co/

Steps to Reproduce the Bug or Issue

  1. Run npm run dev. Everything ok.
  2. Run npm run build to build. Everything ok.
  3. Run npm run preview to check prod version. Error.

Expected Behavior

To load application just like in development mode.

Screenshots or Videos

With npm run dev: image

With npm run build && npm run preview: locally

Platform

Additional context

I know I am very likely missing something or doing something wrong, but I cannot find the answer anywhere, thanks for the support.

oedotme commented 4 months ago

@waldo2810 There's no enough information about your setup, it can be Vite or generouted related.

Could you please provide a minimal reproduction with StackBlitz?

waldo2810 commented 4 months ago

Seems like a Vite issue. This issue may be closed now.

Here2Huynh commented 2 months ago

@waldo2810 Hello, I seem to be having the similar issue but the 404 occurs when navigating to a page that is defined. Can you tell me what did you do to resolve that Vite issue?

waldo2810 commented 2 months ago

@waldo2810 Hello, I seem to be having the similar issue but the 404 occurs when navigating to a page that is defined. Can you tell me what did you do to resolve that Vite issue?

Hi, due to purely skill issues, I ended up using react-router directly.

One thing I can assure you, I wasn't able to reproduce in another environment so I'm positive it was an issue in my code.

I hope that helps and happy coding!