Open moishinetzer opened 1 year ago
Good Catch (pun intended)! Will have a look into this in the coming days.
Digged a little bit into this, here's what I found:
<Links />
in there or manually <link />
to them.<Head />
in the catch boundary<Scripts />
back in our catch boundary we get the styles in the client, but they're missing in the initial server renderFrom what I understand, remix deliberately does not teat the catch-boundary as part of the route. It's a "hey nothing you configured matches this, we don't know what to do here" scenario. Where it might be just false to add the same links, meta-tags to the page as the status: 200
version of the same page has.
I'm not sure how to handle this case in remix-island, the first thought coming to mind is that we'd need a CatchBoundaryHead
component but that also feels a little strange.
All that said... as written in the pitfalls/notes section of the readme I think it makes sense to move everything global out of remix LinksFunction
and MetaFunction
and into the static html template in entry.server.ts
. And if you put your styles in there you should at least have those loaded on 404 pages.
(I understand that does not help with setting a custom title or tracking for those pages)
When catch boundaries are hit, styles and other links are not loaded correctly into the head tag.
Error boundaries, however, work completely fine.