You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have implemented remix-island to solve hydration issues related to extension modifying the DOM. But having an issue when an error is thrown in the Head component, on the server side, the error boundary isn't reached!
As far as I understand this happens because we're calling the renderHeadToString outside of remix domain.
There might be a solution where we'd emulate some of remixes error-handling behavior in renderHeadToString and maybe even communicate back to remix using remixContext but I think that's outside of the scope of this library and your approach seems like a pretty straight forward solution to me.
That said when anyone would like to take a shot at solving this, I'm open to PRs
I'd found this same issue and ended up not using remix-island because of this issue, but I thought as I'd found a simple workaround I'd come back and share it (even though my company has decided to not use remix long term).
functionrenderShell({ remixContext }: {remixContext: EntryContext}){constheadString=renderToString(<RemixHeadercontext={remixContext}url={request.url}/>);
}functionRemixHeader({ context, url }: {context: EntryContext;url: string}){return(<RemixServercontext={{
...context,routeModules: {
...context.routeModules,root: {// changing this seems to allow us to just pass everything down as we remove the `<Outlet />` and override the "ErrorBoundary"default: ()=>(<><Meta/><Links/></>),ErrorBoundary: ()=>(<><Meta/><Links/></>),},},}}url={url}abortDelay={ABORT_DELAY}/>);}
I have implemented
remix-island
to solve hydration issues related to extension modifying the DOM. But having an issue when an error is thrown in theHead
component, on the server side, the error boundary isn't reached!This obviously gives a flash of the application and then the Error Boundary for the user
https://github.com/Xiphe/remix-island/assets/22746959/95622388-3549-43cc-aa6e-88d51bf51701
I have a
SafeHead
when an error is thrown on the server side,SafeHead
being aHead
component with only safe elements that don't have dynamic content.It might be a pitfall of
remix-island
but it's not ideal. Anyone has had the issue and found a workaround?The text was updated successfully, but these errors were encountered: