#How to access loader data in the ErrorBoundary?
1 messages · Page 1 of 1 (latest)
If you throw a response you can include additional data along with the 500 status that can then be read in the ErrorBoundary using useRouteError and isRouteErrorResponse
https://remix.run/docs/en/main/route/error-boundary
Remix
For environment variables, you could create a Document component that encapsulates the html, head, body, Scripts, etc., receives the env values from the root loader and sets them to window. Then use it to wrap the contents of your App and ErrorBoundary, so you'll have access to them in either scenario.
You can find an example in the epic-stack repo: https://github.com/epicweb-dev/epic-stack/blob/main/app/root.tsx#L192-L226