Open benscobie opened 2 months ago
Hey @benscobie thanks for writing in!
We'll look into your issue Next week as this week is Hackweek at Sentry (see #13421).
Hi, could you resolve the problem? It looks like new issues are more or less properly source-mapped via Debug IDs. My best guess is that there was a bit of a race condition when unminifying the event.
Hi, could you resolve the problem? It looks like new issues are more or less properly source-mapped via Debug IDs. My best guess is that there was a bit of a race condition when unminifying the event.
No it's unresolved, a new event came in today with the same issue: https://none-rai.sentry.io/issues/5758279792/?alert_rule_id=15089045&alert_timestamp=1724675822245&alert_type=email&environment=production¬ification_uuid=f1220281-d10a-486f-ae7c-2f9bc1e07e2c&project=4506994036703232
To be clear I've yet to see any successfully unminified third party code in V8 whereas it always worked in v7.
I think the problem is that the page throws at the JS parsing stage. In order to unminify errors via debug IDs, the file needs to be parsed and executed (at least the first statement/debug ID snippet). I guess this is a shortcoming of debug IDs.
I think the problem is that the page throws at the JS parsing stage. In order to unminify errors via debug IDs, the file needs to be parsed and executed (at least the first statement/debug ID snippet). I guess this is a shortcoming of debug IDs.
That makes sense, though in my case it's also failing the old way (releases) due to a mismatch in the stack frame path which I've detailed in the OP. This seems to have changed since v7 as well.
I'm seeing the same issue. My sourcemaps fail to unminify for server-side code (client-side sourcemaps work fine), and they fail to unminify even when I call captureException
from code that is executed well after the debug ID has been parsed and executed.
I too see the "Stack frame doesn't have Debug IDs" message in Sentry even though I can see debug IDs being generated (e.g. ~/273c0a8e-852d-4fa7-a425-281e5df8b8c7-6.js.map (debug id 273c0a8e-852d-4fa7-a425-281e5df8b8c7)
) and debug ID code being executed in each of my source files. My sourcemaps have all been uploaded and linked to issues via release IDs.
I'm using @sentry/nextjs
8.9.1
and next
14.2.6
EDIT: For my particular issue, the problem turned out to be that I was still using ts-node
for prod builds, which was not generating debug IDs in traces. I switched to Node for prod builds, which I was meaning to do anyway, and it fixed the problem.
@hansede that seems like a separate problem. Would you mind opening a new issue with details on your setup? Thanks!
@lforst Do you need anything more from me to investigate?
@benscobie Unfortunately, I don't think there is anything we can do here. In theory it might even be beneficial for you to be pointed to the location inside the minified code because your minified code is the one that is causing a syntax error. <- I see that this is a bit subjective though and intransparent.
The only action item I see right now is to update the docs to explain this.
If you want debug IDs to be able to detect syntax errors check out the TC39 proposal and get involved :) https://github.com/tc39/source-map/blob/main/proposals/debug-id.md
@benscobie Unfortunately, I don't think there is anything we can do here. In theory it might even be beneficial for you to be pointed to the location inside the minified code because your minified code is the one that is causing a syntax error. <- I see that this is a bit subjective though and intransparent.
The only action item I see right now is to update the docs to explain this.
If you want debug IDs to be able to detect syntax errors check out the TC39 proposal and get involved :) https://github.com/tc39/source-map/blob/main/proposals/debug-id.md
Putting the debug ID issue aside completely, is there not a regression with the stack frame path generation here as the file is correctly identified in v7, but not in v8? Without knowing the original unbundled path I have no idea which library in the generated chunk is causing the error.
v7:
v8:
I think it is reasonable to say it is a regression, however, we don't have a fix right now and I think it will be a while before we have one. 😕
We will likely also not increase the priority on fixing this right now, as in the world of errors, linters, and transpilers, SyntaxErrors have become a very very very small subset of errors generated. We're happy to re-evaluate if we receive reports of many more people running into this.
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
8.26.0
Framework Version
Next 14.2.5
Link to Sentry event
https://none-rai.sentry.io/issues/5692732697/events/524b2243e043485caeab2735c6464186/?project=4506994036703232
Reproduction Example/SDK Setup
https://github.com/benscobie/student-loan-repayment-calculator - this is using 8.25.0 but I've tested locally with 8.26.0 and that has the same issue.
Live URL for this project is here: https://www.studentloanrepaymentcalc.co.uk/
This is happening in 3rd party code with widenClientFileUpload, I've not tested this with first party code yet.
Steps to Reproduce
Expected Result
The code is correctly unminified as was the case in v7
Actual Result
The code cannot be unminified in the UI. The Releases tab has the error Stack frame path doesn't match a source file artifact name and the debug IDs tab has Stack frame doesn't have Debug IDs.
The artifact bundles in the latest v7 release has the ~/_next/static/ file path like so: ~/_next/static/chunks/555-d441d4fd54bfbe83.js Sourcemap Reference: 555-d441d4fd54bfbe83.js.map
The artifact bundles in the latest v8 release doesn't contain that file path, though I'm not sure if that is by design given the addition of debug IDs: ~/09b852f2-09fc-41b1-a8af-c8a3c4a613ef-0.js Sourcemap Reference: 236.js.map Debug ID: 09b852f2-09fc-41b1-a8af-c8a3c4a613ef
After reading the troubleshooting guide I couldn't locate the debug_meta in the v8 event payload.
The debug IDs appear to be injected as seen here (this is the path referenced in the v8 event): https://www.studentloanrepaymentcalc.co.uk/_next/static/chunks/ee8b1517-f26c95194c102265.js
In v7 the code is mapped, an example event using the latest v7 is here: https://none-rai.sentry.io/issues/5271420882/events/224718c00bc142198e9deefad68eb5b3/?project=4506994036703232&statsPeriod=14d
Whereas a V8 event doesn't map for the same error: https://none-rai.sentry.io/issues/5692732697/events/524b2243e043485caeab2735c6464186/?project=4506994036703232
Log when uploading with v8:
Log from uploading with v7:
I'm having the same issue in a work related project too so very keen to help get this resolved.