Fix execution freezing on debugger statements when DevTools is not attached#12835
Fix execution freezing on debugger statements when DevTools is not attached#12835dario-piotrowicz merged 2 commits intomainfrom
debugger statements when DevTools is not attached#12835Conversation
🦋 Changeset detectedLatest commit: 50944aa The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
✅ All changesets look good |
|
Now I have a clear picture of the change. Let me analyze the logic:
The change is clean and correct. The changeset is properly formatted. The only thing removed is the premature LGTM |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
|
Codeowners approval required for this PR:
Show detailed file reviewers |
490609a to
a9d451f
Compare
a9d451f to
e0f2fa9
Compare
petebacondarwin
left a comment
There was a problem hiding this comment.
I am going to pull this down to test but LGTM.
One question... should we disable when the devtools closes? Or does it do that for us?
petebacondarwin
left a comment
There was a problem hiding this comment.
This does fix the direct issue of debugger statements blocking execution when the devtools has not yet started. So approving this PR as an improvement.
But there is an additional problem... if you open up the devtools it will enable the debugger as desired. But then if you close the devtools the debugger is still enabled and will resort to blocking the request again.
So as a follow up we should investigate how to solve that.
|
Thanks a lot @petebacondarwin 😄 Yeah I didn't consider the devtools closing situation! 😓 I'll quickly look into it now 🙏 |
|
Codeowners approval required for this PR:
Show detailed file reviewers |
|
@petebacondarwin 50944aa should address the client closing concern 😄 (again, thanks a lot for surfacing the issue! 🙏) Please have another look 🙂🙏 |
petebacondarwin
left a comment
There was a problem hiding this comment.
Great! I didn't try the disable bit manually but it looks solid. Thanks Dario.
Fixes #7956
Previously,
wrangleralways tried to connect to an inspector debugger, even when DevTools wasn't open. This caused scripts to freeze ondebuggerstatements. Now the connection is only made when DevTools is actually attached.npm iandnpm start, try fetching/visiting the worker's url and notice its execution being blockednpm i https://pkg.pr.new/wrangler@12835)npm startagain and see that the execution is no longer blockeddhotkey and fetch from the worker again, see that debugging still works as expectednpm startin a vscode debugger terminal and see that debugging still works as expectedchrome://inspectpage, see that debugging still works as expectedA picture of a cute animal (not mandatory, but encouraged)