Closed Bug 1739382 Opened 3 years ago Closed 2 years ago

In projects using Vite the Debugger seems to crash when using breakpoints

Categories

(DevTools :: Debugger, defect)

Firefox 94
defect

Tracking

(firefox-esr91 fixed, firefox96 fixed, firefox97 fixed)

RESOLVED FIXED
97 Branch
Tracking Status
firefox-esr91 --- fixed
firefox96 --- fixed
firefox97 --- fixed

People

(Reporter: flaki, Assigned: bomsy, NeedInfo)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

Reproduction steps:

  • Clone https://github.com/vuejs/petite-vue
  • yarn && yarn dev
  • Open devtools
  • Place a breakpoint in one of the TS files (e.g. src/directives/for.ts)
  • Reload the page with the devtools open

The result is Firefox reporting that the debugger has crashed, probably applies to other projects using Vite as well.

Error: source source-http://localhost:3000/src/directives/for.ts/originalSource-7c71a04884cf3b75848b5c8a20d28a13 does not exist
    in Connect(SecondaryPanes)
    in div
    in div
    in SplitBox
    in div
    in A11yIntention
    in AppErrorBoundary
    in div
    in App
    in Connect(App)
    in Provider
    in Provider
Flags: needinfo?(odvarko)

Thank you for the report!

I tried to reproduce the problem on my machine, but I can't see the Debugger crash.

Here is what I am doing

  1. Clone https://github.com/vuejs/petite-vue
  2. yarn && yarn dev
  3. Open devtools on http://localhost:3000/
  4. Adding BP into src/client.ts, line 50 (btw. I don't see src/directives/for.ts file, perhaps the repo changed since the bug has been filed?)
  5. Reloading the page
  6. Hitting the BP, all OK

What exactly should I do to repro the problem?
Does my step work for you?

Flags: needinfo?(odvarko) → needinfo?(bugzilla)
See Also: → 1743597

Nicolas reproduced the issue once, can you share the STRs once you narrowed them down.

Flags: needinfo?(nchevobbe)
Assignee: nobody → hmanilla
Status: NEW → ASSIGNED

The issue here was sourcemapped (original) files are throttled using the SourceQueue so
sometimes on reload the original sources gets created late, and the source for the selected frame
does not yet exist when it is needed.

The SourceQueue is currently only used to for sourcemapped files, it's worth using the
opportunity to clean it all up.

Depends on D132917

(tested Hubert's patch that seems to fix the issue)

Flags: needinfo?(nchevobbe)

Adding a more specific STR which reproduces the issue for me

  1. Clone https://github.com/vuejs/petite-vue
  2. yarn && yarn dev
  3. Open devtools on http://localhost:3000/
  4. Go to http://localhost:3000/tests/html.html
  5. Open the debugger
  6. Click this source from the source tree Users/hubertbomamanilla/Projects/petite-vue/src/ -> app.ts
  7. Set breakpoint on line 13
  8. Reload the page

ER

The debugger should pause on breakpoint

AR

The debugger crashes

Pushed by hmanilla@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4f480706ada6
[devtools] Display a console warning instead of throwing error (causing a debugger crash) r=nchevobbe
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch

Comment on attachment 9253839 [details]
Bug 1739382 - [devtools] Display a console warning instead of throwing error (causing a debugger crash) r=nchevobbe

Beta/Release Uplift Approval Request

  • User impact if declined: Debugger panel crashes
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): It small javascript change. It stops throwing errors (which causes crashing), instead logs warning to the browser console
  • String changes made/needed:
Attachment #9253839 - Flags: approval-mozilla-beta?

:bomsy can you attach D132918 to a new bug for better tracking purposes?
Also does this need to be uplifted for ESR as well?

Flags: needinfo?(hmanilla)

Comment on attachment 9253839 [details]
Bug 1739382 - [devtools] Display a console warning instead of throwing error (causing a debugger crash) r=nchevobbe

Approved for 96.0b3

Attachment #9253839 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Blocks: 1745143

Comment on attachment 9253840 [details]
Bug 1739382 - [devtools] Remove sourceQueue used for sourcemapped files r=ochameau

Revision D132918 was moved to bug 1745143. Setting attachment 9253840 [details] to obsolete.

Attachment #9253840 - Attachment is obsolete: true

Comment on attachment 9253839 [details]
Bug 1739382 - [devtools] Display a console warning instead of throwing error (causing a debugger crash) r=nchevobbe

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Helps avoid potential crash scenario
  • User impact if declined: Devtools debugger will crash if a scenario where a source is not found.
  • Fix Landed on Version: 97
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Stops throwing errors, instead logs error to browser console
  • String or UUID changes made by this patch:
Flags: needinfo?(hmanilla)
Attachment #9253839 - Flags: approval-mozilla-esr91?

Also does this need to be uplifted for ESR as well?

Yes it would benefit from avoiding that potential crash scenario.

Comment on attachment 9253839 [details]
Bug 1739382 - [devtools] Display a console warning instead of throwing error (causing a debugger crash) r=nchevobbe

Approved for 91.5esr.

Attachment #9253839 - Flags: approval-mozilla-esr91? → approval-mozilla-esr91+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: