-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remix SDK not reporting server errors to Sentry #6951
Comments
Hi, if you add |
Hello! I have virtually the same set up to @oliversong and I'm running into the same issue. Some additional details: Which package are you using?@sentry/remix SDK Version7.33.0 Framework VersionLink to Sentry eventNo response SDK SetupIn an example app generated with this template, I followed the setup documentation like OP did. The only difference is this app uses a custom express server, so I wrapped const createSentryRequestHandler = wrapExpressCreateRequestHandler(createRequestHandler);
app.all('*', createSentryRequestHandler({build: require(BUILD_DIR)})); Steps to ReproduceSame as OP, I raise an error on the client and server side suggested by documentation Expected ResultErrors should show up in Sentry for both of these. Actual ResultError only appears for the client side error. The server side error never appears. In addition, setting export const action: ActionFunction = async ({ request }) => {
try {
throw new Error("Sentry Error");
} catch (err) {
Sentry.captureException(err);
}
}; Notes
|
I also tried |
I'm having the same issue, however I feel it has to do with lack of documentation personally, It seems like something is missing. I don't see how initing the sentry class is enough for it to work, but perhaps I got it wrong. I'm using remix 1.12 and cloudflare pages |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you label it "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
Bump: wondering if folks have had a chance to look at this issue? |
I've given up on the issue and implemented using the ErrorBoundary to report errors to me, There were too many issues using cloudflare pages and sentry as is, so I've done all workarounds as I can.
I work in a startup where speed of development is key, so I have no time to help out and debug the issue. I could get debug logs but they gave nothing that was unusual. I hope a solution will be found and posted here. Or developer will extensively test this on cloudflare pages as it's one of remix' main partners. Actually I'm lyiing, I did get this debug log: here is my basic implementation:
entry.server.tsx
root.tsx
It's also good to mention that cloudflare pages environment variables aren't readable without context (which you only get through loader or action function), would be nice if you found a solution for that. For now during the build it'll create an environment variable it can read. |
Bump, any update? I am also dealing with this issue. |
Bump, also running into this issue. |
Hey folks - thanks for reaching out. We've escalated this so we can investigate further! |
I attempted to reproduce this - but was unable to: https://github.com/AbhiPrasad/GH-6951-sentry-remix-express. Could anyone provide a reproduction that shows this not working? Here's a super barebones example app I used. It uses an express server request handler like the OP posted. With the example I could throw errors in actions, and in loaders and get resulting errors in Sentry. Important to note - we only support the remix server and express server adapters - everything else needs to be manually instrumented by you. With that in mind Remix v2 is coming out though - and I think it makes sense for us to re-evaluate instrumenting remix from first principles. We've learned a lot from revamping our Next.js SDK and creating the SvelteKit SDK that we can bring back to the Remix SDK. v2 support - #7810 |
I believe this is an issue with Sentry supporting Cloudflare Pages, as I'm having the same issue. It happens consistently both with miniflare locally and on deployment. |
See #5610 on Cloudflare Workers support @KrisBraun |
I'm going to close this because we haven't got a reproduction, and I can't see to understand how this is not working when you are using the remix server or express server adapters. Please re-open or create a new issue if you can get a reproduction, thanks! |
@AbhiPrasad Your working demo got a lot more @sentry dependencies, than a regular setup + there are no versions but somekind of file:.yalc/ thing there:
But the default when installing sentry is only:
Using Remix Server and in the entry.server.jsx file having these lines related to Sentry:
In root.jsx:
Client side works correctly, so not going to paste the client code here, but yes like lots of folks discussing here, that the server implementation is not working with Remix Server when trying to implement as described in the docs. |
Same here - client side working, server side is not reporting anything whatsoever. @AbhiPrasad you repro only works cause you are explicitly catching errors. But unhandled errors are not getting reported to sentry. If you remove the catch block (like in the official sentry example), you will be able to reproduce the issue. |
I opened a new issue here: #6951 |
Adding this to export function handleError(
error: unknown,
{ request }: DataFunctionArgs
): void {
if (error instanceof Error) {
Sentry.captureRemixServerException(error, "remix.server", request);
} else {
// Optionally capture non-Error objects
Sentry.captureException(error);
}
} |
Yeah I think we should recommend using v2 error handling since they fixed a lot of things we no longer have to deal with, otherwise it's tricky getting the correct client/server separation. docs: https://docs.sentry.io/platforms/javascript/guides/remix/#remix-v2-features |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which package are you using?
@sentry/remix
SDK Version
7.33.0
Framework Version
1.8.2
Link to Sentry event
No response
SDK Setup
AFAICT, I've set up our code exactly as in the documentation and example vanguard app.
I've double checked that the environment variables are being passed correctly on both the client and the server init calls.
Steps to Reproduce
Expected Result
Errors should show up in Sentry for both of these.
Actual Result
Error only appears for the client side error. The server side error never appears.
If I set an explicit
captureException
call in the error boundary inroot.tsx
, then that will be reported and show in Sentry.I've also tried removing the error boundary in
root.tsx
entirely (thinking it may be conflicting), to no avail.For whatever reason, I just cannot get sentry's default instrumentation on the server side to function at all.
The text was updated successfully, but these errors were encountered: