Closed
Description
Describe the bug
After building a Vite 4 app with multiple routes, serving the build preview results in Cannot GET [route path] when accessing the route directly via URL (not using router Link / navigate)
Your Example Website or App
Steps to Reproduce the Bug or Issue
- Go to sandbox
- Run
buildcommand - Run
previewcommand - Open the
previewwindow in a separate tab - Navigate to
/params/list - Reload the page to get the behaviour
- See the error
Warning
Cannot GET "/param/list"
Screen-cast of the process
I've attached a screen-cast of the process on how to reproduce the behaviour via the provided codesanbox
Expected behavior
I expect all routes to be defined and accessible in production build of the app
Screenshots or Videos
router-vite-4-build-preview-404-screencast.mp4
Platform
- OS: macOS
- Browser: Firefox
- Version: 108.0b9
Additional context
I'm not sure if it's primarily a TS Router bundling issue or a Vite 4 one
Reacted by Rifaldhi AW
Metadata
Metadata
Assignees
Labels
No labels
Activity
Moshyfawn commentedon Dec 13, 2022
Alright, it was a Vite issue reported in vitejs/vite#10564 and fixed in the latest 4.0.1 release.
Here's a working repro with
cc: @rifaldhiaw