Title: `SyntaxError` didn't report :line:offset for `Unexpected strict mode reserved word` · Issue #61349 · nodejs/node · GitHub
Open Graph Title: `SyntaxError` didn't report :line:offset for `Unexpected strict mode reserved word` · Issue #61349 · nodejs/node
X Title: `SyntaxError` didn't report :line:offset for `Unexpected strict mode reserved word` · Issue #61349 · nodejs/node
Description: Version v24.2.0 Platform Linux fd829b446dea 6.6.96-0-virt #1-Alpine SMP PREEMPT_DYNAMIC 2025-07-07 15:18:25 aarch64 GNU/Linux Subsystem modules/esm/utils What steps will reproduce the bug? Create a file test/00.internal.Link.js with: /* ...
Open Graph Description: Version v24.2.0 Platform Linux fd829b446dea 6.6.96-0-virt #1-Alpine SMP PREEMPT_DYNAMIC 2025-07-07 15:18:25 aarch64 GNU/Linux Subsystem modules/esm/utils What steps will reproduce the bug? Create a...
X Description: Version v24.2.0 Platform Linux fd829b446dea 6.6.96-0-virt #1-Alpine SMP PREEMPT_DYNAMIC 2025-07-07 15:18:25 aarch64 GNU/Linux Subsystem modules/esm/utils What steps will reproduce the bug? Create a...
Opengraph URL: https://github.com/nodejs/node/issues/61349
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`SyntaxError` didn't report :line:offset for `Unexpected strict mode reserved word`","articleBody":"### Version\n\nv24.2.0\n\n### Platform\n\n```text\nLinux fd829b446dea 6.6.96-0-virt #1-Alpine SMP PREEMPT_DYNAMIC 2025-07-07 15:18:25 aarch64 GNU/Linux\n```\n\n### Subsystem\n\nmodules/esm/utils\n\n### What steps will reproduce the bug?\n\nCreate a file `test/00.internal.Link.js` with:\n```js\n/* eslint-disable sort-keys */\nimport {describe, it} from \"mocha\";\nimport {expect} from \"chai\";\nimport isString from \"is-string\";\nimport Link, {BROKEN_REASON, EXCLUDED_REASON, HTML_ATTR_NAME, HTML_ATTRS, HTML_BASE_HREF, HTML_INDEX, HTML_LOCATION, HTML_OFFSET_INDEX, HTML_SELECTOR, HTML_TAG, HTML_TAG_NAME, HTML_TEXT, HTTP_RESPONSE, HTTP_RESPONSE_WAS_CACHED, IS_BROKEN, IS_INTERNAL, IS_SAME_PAGE, ORIGINAL_URL, REBASED_BASE_URL, REBASED_URL, REDIRECTED_URL, RESOLVED_BASE_URL, RESOLVED_URL, WAS_EXCLUDED} from \"../lib/internal/Link.js\";\nimport {simplifyLink} from \"./helpers/index.js\";\nimport URL_TESTS from \"./fixtures-json/Link.json\" with { type: \"json\" };\n\n```\n\n---\n\nBefore doing that, create it _without_ `with { type: \"json\" }` to get:\n\n```js\n Exception during run: TypeError [ERR_IMPORT_ATTRIBUTE_MISSING]: Module \"file:///broken-link-checker/test/fixtures-json/Link.json\" needs an import attribute of \"type: json\"\n at validateAttributes (node:internal/modules/esm/assert:88:15)\n at defaultLoad (node:internal/modules/esm/load:129:3)\n at async ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:592:32) {\n code: 'ERR_IMPORT_ATTRIBUTE_MISSING'\n}\n```\n\nBut when _adding_ `with { type: \"json\" }`, the result is:\n```js\n Exception during run: SyntaxError[ @/broken-link-checker/test/00.internal.Link.js ]: Unexpected strict mode reserved word\n at compileSourceTextModule (node:internal/modules/esm/utils:351:16)\n at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:107:18)\n at #translate (node:internal/modules/esm/loader:546:12)\n at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:593:27)\n```\n\nNote that in both cases, there is no line number/offset\n\n### How often does it reproduce? Is there a required condition?\n\n100%\n\n### What is the expected behavior? Why is that the expected behavior?\n\nAll other files in the stack trace include a line number and offset. Ideally the faulting line should too (it's the one that humans are most interested in).\n\n### What do you see instead?\n\n\u003e Exception during run: SyntaxError[ @/broken-link-checker/test/00.internal.Link.js ]: Unexpected strict mode reserved word\n\n### Additional information\n\n```sh\ndocker run -it --entrypoint bash node\n```\n```sh\ngit init broken-link-checker\ncd broken-link-checker\ngit remote add origin https://github.com/jsoref/broken-link-checker/\ngit fetch origin 1a0bdd1e0b2159f939af4ec24aa8e0bd2382311f\ngit checkout FETCH_HEAD\nnpm install\nnpm run test\n```","author":{"url":"https://github.com/jsoref","@type":"Person","name":"jsoref"},"datePublished":"2026-01-12T00:34:01.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/61349/node/issues/61349"}
| 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:3206127a-2c09-4708-7143-2199f065909d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AEA8:35A89A:682749:899882:696485CC |
| html-safe-nonce | 99df7249ac7a91df44ec1718da7d83a000da07a644e8fb71093eccabe6495340 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRUE4OjM1QTg5QTo2ODI3NDk6ODk5ODgyOjY5NjQ4NUNDIiwidmlzaXRvcl9pZCI6Ijc5MTQ2MTQ4MjI1NzExMTU5ODAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ca48ed35118ccb964b6081eaef974fa1d52d18c2290c2e973944ac38b0c38767 |
| hovercard-subject-tag | issue:3802375662 |
| 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/61349/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2bbbce2b855302595f118b7d2d1f36aa9a6cb69c4aa3d2d4b9a1b45e0e13ecf2/nodejs/node/issues/61349 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2bbbce2b855302595f118b7d2d1f36aa9a6cb69c4aa3d2d4b9a1b45e0e13ecf2/nodejs/node/issues/61349 |
| og:image:alt | Version v24.2.0 Platform Linux fd829b446dea 6.6.96-0-virt #1-Alpine SMP PREEMPT_DYNAMIC 2025-07-07 15:18:25 aarch64 GNU/Linux Subsystem modules/esm/utils What steps will reproduce the bug? Create a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jsoref |
| hostname | github.com |
| expected-hostname | github.com |
| None | baa7d9900fdf7b27d604f36887af878d569cfbdcf97126832a5f4f0caf0c6ba5 |
| 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 | 842eff1d11f899d02b6b3b98fa3ea4860e64b34e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width