Open phil714 opened 4 weeks ago
Thanks for reporting @phil714. Would you be interesting in trying to upgrade our Sentry integration? A PR would be more than welcome 🙏
Thanks for reporting @phil714. Would you be interesting in trying to upgrade our Sentry integration? A PR would be more than welcome 🙏
Would gladly upgrade Sentry but I'm not exactly sure what is the best way to solve the typing issue. The FatalErrorPage
typing doesn't match with what can be sent to the Sentry.ErrorBoundary
given that it is both used for dev and production build and the Sentry.ErrorBoundary
seems to be geared toward a production error fallback.
I feel like we should we should keep the original FatalErrorBoundary
that is there before we configure sentry and just pass the non-dev error to Sentry but it seems like it wouldn't work with the way the FatalErrorPage
is created right now. Something like that:
// ./src/App.tsx
<FatalErrorBoundary page={FatalErrorPage}>
<Sentry.ErrorBoundary fallback={MyErrorPage}>
<RedwoodProvider titleTemplate="%PageTitle | %AppTitle">
<RedwoodApolloProvider>{children}</RedwoodApolloProvider>
</RedwoodProvider>
</Sentry.ErrorBoundary>
</FatalErrorBoundary>
// ./src/pages/FatalErrorPage.tsx
import { DevFatalErrorPage } from '@redwoodjs/web/dist/components/DevFatalErrorPage'
export default DevFatalErrorPage || MyErrorPage;
For this to work, the default RedwoodJS project should split the FatalErrorPage into two components which I'm not sure is desirable.
What's not working?
I tried adding the using the command
yarn redwood setup monitoring sentry
and noticed that my type checking job was failing because of there was a typing mismatch between Sentry.ErrorBoundary fallback props and the FatalErrorPage (specifically, the DevFatalErrorPage) . Tried reproducing on a new repository and got the same problem.I got around that by ignoring the typing there but doesn't seems like the best solution.
I also noticed that the package is very outdated, the way the browser tracing integration works is deprecated now
How do we reproduce the bug?
yarn create redwood-app my-redwood-project --typescript
yarn redwood setup monitoring sentry
yarn rw type-check
16
src/App.tsx:16:34 16