Remix backend errors captured but code is not shown (missing context-line)
Is there an existing issue for this?
- [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- [X] I have reviewed the documentation https://docs.sentry.io/
- [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/remix
SDK Version
7.110.1
Framework Version
Remix 7.110.1
Link to Sentry event
https://alhona.sentry.io/share/issue/e0a215fdaaf44b5bbf7bff7641264eb9/
SDK Setup
In entry.server.tsx
Sentry.init({
environment: process.env.NODE_ENV,
release: process.env.LAST_COMMIT_ID,
dsn: process.env.SENTRY_DSN,
tracesSampleRate: 1.0,
debug: true,
});
Steps to Reproduce
- Follow Manual Setup instructions to integrate Remix both in frontend and backend
- Generate a backend error in an action function
export async function action() {
throw new Error("Remix BFF error");
}
Expected Result
We would like to see an Issue with the code snippet that generated the error
Actual Result
The error is captured, and the file and line that generated the error is shown but not the code snippet
context-line is missing for the last frame
@adriwicked are you uploading source maps? https://docs.sentry.io/platforms/javascript/guides/remix/sourcemaps/
@AbhiPrasad Yes, with each release we upload the sourcemaps. We can see the errors generated in the frontend without any problem, including the code snippet.
Frontend issues includes context-line in their stack trace
The problem only occurs in backend side (loaders and actions)
So I assume this only happens for production builds, which means it's probably because we are unable to grab context when bundling.
Are you using vite? Could you share your remix backend Sentry.init call?
@onurtemizkan could you investigate further when you take a look?
@AbhiPrasad yeah, that's right. It only happens for production builds.
No, we are not using vite. Here you have our Sentry.init call:
Sentry.init({
environment: process.env.NODE_ENV,
release: process.env.LAST_COMMIT_ID,
dsn: process.env.SENTRY_DSN,
tracesSampleRate: 1.0,
debug: true,
});
Any news on this? I have the same problem
@NachoLZ are you able to provide a reproduction with a simple remix app @NachoLZ? That will help us debug further.
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 remove the label Waiting for: Community, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀