solid-start
solid-start copied to clipboard
Pathless routes + ErrorBoundary not working properly
Hey!
Pathless routes and ErrorBoundary doesn't seem to work properly. When switching between routes, the content of the previous route is rendered below the new route.
I noticed that when the children of <ErrorBoundary />
(routes/nested/[slug].tsx
file) aren't wrapped with a <div>
it sometimes works. The same happens with <Outlet />
(routes/(app).tsx
file). Wrapping it with a <div>
breaks it, having it at the root works. IIRC this doesn't happen for non-pathless routes.
Also, the ErrorBoundary doesn't catch errors in production. It works in development and shows the fallback content but in production (deployed on Vercel) the function crashes. I tested this with a non-pathless route in production and it showed the fallback content.
Reproduction: https://github.com/m4rvr/solid-start-bug
- npm run dev
- Go to http://127.0.0.1:3000/nested/foo
- Click on link "back to home"
- home route should show content of itself + content of nested route below like this
I could imagine that if the pathless routes work properly, the failing ErrorBoundary in production could be fixed too.
(probably related issue #493 )