Title: Pause on uncaught exceptions stops at wrong position with ES modules · Issue #38439 · nodejs/node · GitHub
Open Graph Title: Pause on uncaught exceptions stops at wrong position with ES modules · Issue #38439 · nodejs/node
X Title: Pause on uncaught exceptions stops at wrong position with ES modules · Issue #38439 · nodejs/node
Description: Version: 16.0.0 Platform: Win 10 x64 Subsystem: inspector What steps will reproduce the bug? Here's a repo with an easy reproduction: Open the repo in VS Code (or you can use another tool/any debugger) In the debug view (play button on t...
Open Graph Description: Version: 16.0.0 Platform: Win 10 x64 Subsystem: inspector What steps will reproduce the bug? Here's a repo with an easy reproduction: Open the repo in VS Code (or you can use another tool/any debug...
X Description: Version: 16.0.0 Platform: Win 10 x64 Subsystem: inspector What steps will reproduce the bug? Here's a repo with an easy reproduction: Open the repo in VS Code (or you can use another tool/any d...
Opengraph URL: https://github.com/nodejs/node/issues/38439
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Pause on uncaught exceptions stops at wrong position with ES modules","articleBody":"\u003c!--\r\nThank you for reporting an issue.\r\n\r\nThis issue tracker is for bugs and issues found within Node.js core.\r\nIf you require more general support please file an issue on our help\r\nrepo. https://github.com/nodejs/help\r\n\r\n\r\nPlease fill in as much of the template below as you're able.\r\n\r\nVersion: output of `node -v`\r\nPlatform: output of `uname -a` (UNIX), or output of `\"$([Environment]::OSVersion | ForEach-Object VersionString) $(if ([Environment]::Is64BitOperatingSystem) { \"x64\" } else { \"x86\" })\"` in PowerShell console (Windows)\r\nSubsystem: if known, please specify affected core module name\r\n-->\r\n\r\n* **Version**: 16.0.0\r\n* **Platform**: Win 10 x64\r\n* **Subsystem**: inspector\r\n\r\n### What steps will reproduce the bug?\r\n\r\n[Here's a repo](https://github.com/connor4312/node-38439) with an easy reproduction:\r\n\r\n1. Open the repo in VS Code (or you can use another tool/any debugger)\r\n2. In the debug view (play button on the left hand side):\r\n - Check the `[x] Uncaught Exceptions` box in the breakpoints view.\r\n - Select \"No Bug\" and hit the play button. This runs `no-bug/index.js`.\r\n3. The debugger pauses at the location of the `throw`\r\n4. Now select \"Repro Bug\", and hit the play button. This runs `bug/index.js`: the same code in an ES module.\r\n5. The debugger pauses inside internal Node.js module code:\r\n\r\n\r\n\r\nUnder the hood this is just calling `Debugger.setPauseOnExceptions({ state: 'uncaught' })`, so it should be reproducable with any tool. In both cases this leads to a `Debugger.pause`, with the latter in the wrong location.\r\n\r\nI'm guessing there's some inspector ✨magic that happens with commonjs that isn't happening for ES modules.\r\n\r\n### How often does it reproduce? Is there a required condition?\r\n\r\n100%\r\n\r\n### What is the expected behavior?\r\n\r\nIn both cases, the debugger should pause on the `throw`\r\n\r\n### What do you see instead?\r\n\r\nIn ES modules, it pauses in module_job.js.\r\n\r\n### Additional information\r\n\r\nThis was originally reported in https://github.com/microsoft/vscode/issues/122246","author":{"url":"https://github.com/connor4312","@type":"Person","name":"connor4312"},"datePublished":"2021-04-27T15:54:15Z","url":"https://github.com/nodejs/node/issues/38439"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:38654ae5-b997-80a5-f539-beb518a32ef3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D85A:2A8F8B:100047C:14CCA8A:6B04ED86 |
| html-safe-nonce | 4a2387964b7ab2cb02eb2ea9223db541dc9a3d851478940d28686cd5227fbab1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODVBOjJBOEY4QjoxMDAwNDdDOjE0Q0NBOEE6NkIwNEVEODYiLCJ2aXNpdG9yX2lkIjoiNDMzMjA4Mjg0MTc5OTQyMTMxOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f99644c6c874d785f096a06be7a1af6174a23b6dd43702ffbe95196e3f6c4d95 |
| hovercard-subject-tag | issue:869001292 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/38439/issue_layout |
| twitter:image | https://opengraph.githubassets.com/408334f9be788489eda06759cc6b2782d26df19dc6667dd9ca60e24f78034242/nodejs/node/issues/38439 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/408334f9be788489eda06759cc6b2782d26df19dc6667dd9ca60e24f78034242/nodejs/node/issues/38439 |
| og:image:alt | Version: 16.0.0 Platform: Win 10 x64 Subsystem: inspector What steps will reproduce the bug? Here's a repo with an easy reproduction: Open the repo in VS Code (or you can use another tool/any debug... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | connor4312 |
| hostname | github.com |
| expected-hostname | github.com |
| None | f3851aad500d8e8dce736722ddc6fa9596e17d9fce3c53581eba968664c0bc32 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e29c922455fd8137f27e1cfcdf6a1e8b920b1926 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width