Title: SyntaxError stack trace source maps · Issue #4 · nodejs/typescript · GitHub
Open Graph Title: SyntaxError stack trace source maps · Issue #4 · nodejs/typescript
X Title: SyntaxError stack trace source maps · Issue #4 · nodejs/typescript
Description: With nodejs/node#54283 (comment), when the source codes containing syntax errors (like yet to be supported ECMAScript syntaxes) are used with the flag --experimental-tranform-types, there is no time for --enable-source-maps to collect so...
Open Graph Description: With nodejs/node#54283 (comment), when the source codes containing syntax errors (like yet to be supported ECMAScript syntaxes) are used with the flag --experimental-tranform-types, there is no tim...
X Description: With nodejs/node#54283 (comment), when the source codes containing syntax errors (like yet to be supported ECMAScript syntaxes) are used with the flag --experimental-tranform-types, there is no tim...
Opengraph URL: https://github.com/nodejs/typescript/issues/4
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SyntaxError stack trace source maps","articleBody":"With https://github.com/nodejs/node/pull/54283#issuecomment-2283390708, when the source codes containing syntax errors (like yet to be supported ECMAScript syntaxes) are used with the flag `--experimental-tranform-types`, there is no time for `--enable-source-maps` to collect source maps and perform stack trace mapping, as it collect source maps information from V8 parse results.\r\n\r\n```ts\r\nconst obj = {\r\n [Symbol.dispose]() {\r\n console.log('disposed')\r\n }\r\n}\r\n\r\nfunction foo() {\r\n using _ = obj;\r\n}\r\n```\r\n\r\nFor example, if the following snippet is been parsed as JS, the error would be:\r\n\r\n```\r\nfile:///Users/cwu631/Developer/nodejs/node/a.mjs:8\r\n using _ = obj;\r\n ^\r\n\r\nSyntaxError: Unexpected identifier '_'\r\n at compileSourceTextModule (node:internal/modules/esm/utils:337:16)\r\n at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:166:18)\r\n at callTranslator (node:internal/modules/esm/loader:436:14)\r\n at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:442:30)\r\n at async ModuleJob._link (node:internal/modules/esm/module_job:106:19)\r\n\r\nNode.js v23.0.0-pre\r\n```\r\n\r\nHowever, if it is parsed as TS:\r\n\r\n```\r\n~/D/n/node (pr-54283)> ./node --experimental-transform-types a.mts\r\n(node:11541) ExperimentalWarning: Type Stripping is an experimental feature and might change at any time\r\n(Use `node --trace-warnings ...` to show where the warning was created)\r\nfile:///Users/cwu631/Developer/nodejs/node/a.mts:7\r\n using _ = obj\r\n ^\r\n\r\nSyntaxError: Unexpected identifier '_'\r\n at compileSourceTextModule (node:internal/modules/esm/utils:337:16)\r\n at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:166:18)\r\n at ModuleLoader.\u003canonymous> (node:internal/modules/esm/translators:540:10)\r\n at callTranslator (node:internal/modules/esm/loader:436:14)\r\n at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:442:30)\r\n at async ModuleJob._link (node:internal/modules/esm/module_job:106:19)\r\n\r\nNode.js v23.0.0-pre\r\n```\r\n\r\nNote that the reported syntax error line number is 7, not 8 as expected.","author":{"url":"https://github.com/legendecas","@type":"Person","name":"legendecas"},"datePublished":"2024-08-12T08:56:35Z","url":"https://github.com/nodejs/typescript/issues/4"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| 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:227c34ef-e828-1c2c-fb17-0420216ed63c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E400:2CAC94:680899:87858F:6AED2EE3 |
| html-safe-nonce | eff9fb5b66eeef5b0eaac88b8d910876370ab4b5f588abc11b761217f93af024 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNDAwOjJDQUM5NDo2ODA4OTk6ODc4NThGOjZBRUQyRUUzIiwidmlzaXRvcl9pZCI6IjkxNjk2MDg0MDI1NDE1NTU0MjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | da53287dee9663a3c647412e87f1eb9c4b771223c523c651d4c3c683cfa10504 |
| hovercard-subject-tag | issue:2460412077 |
| 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/typescript/4/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5eb259a26047b4037d72ad7bc409764ff1d4cd02ed268063720ba40b88ecf40f/nodejs/typescript/issues/4 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5eb259a26047b4037d72ad7bc409764ff1d4cd02ed268063720ba40b88ecf40f/nodejs/typescript/issues/4 |
| og:image:alt | With nodejs/node#54283 (comment), when the source codes containing syntax errors (like yet to be supported ECMAScript syntaxes) are used with the flag --experimental-tranform-types, there is no tim... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | legendecas |
| hostname | github.com |
| expected-hostname | github.com |
| None | e51d0b7b5ab34b1688c05b54c3ed17b8658b2fa9bca973a9c740683ccb12cf4a |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/typescript git https://github.com/nodejs/typescript.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 835214564 |
| octolytics-dimension-repository_nwo | nodejs/typescript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 835214564 |
| octolytics-dimension-repository_network_root_nwo | nodejs/typescript |
| 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 | 59ebb7b901cc154ecc179a44f266fcf69f343b30 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width