solid-start icon indicating copy to clipboard operation
solid-start copied to clipboard

Pathless routes + ErrorBoundary not working properly

Open m4rvr opened this issue 1 year ago • 0 comments

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

  1. npm run dev
  2. Go to http://127.0.0.1:3000/nested/foo
  3. Click on link "back to home"
  4. home route should show content of itself + content of nested route below like this CleanShot 2022-12-02 at 14 20 12@2x

I could imagine that if the pathless routes work properly, the failing ErrorBoundary in production could be fixed too.

(probably related issue #493 )

m4rvr avatar Dec 02 '22 13:12 m4rvr