Title: bogus error "Parenthesized expression cannot be empty" · Issue #60007 · nodejs/node · GitHub
Open Graph Title: bogus error "Parenthesized expression cannot be empty" · Issue #60007 · nodejs/node
X Title: bogus error "Parenthesized expression cannot be empty" · Issue #60007 · nodejs/node
Description: Version v22.8.0 Platform Linux samual-nixos 6.12.48 #1-NixOS SMP PREEMPT_DYNAMIC Fri Sep 19 14:35:52 UTC 2025 x86_64 GNU/Linux Subsystem Modules: TypeScript What steps will reproduce the bug? const foo = (): (void) => {} Run node script....
Open Graph Description: Version v22.8.0 Platform Linux samual-nixos 6.12.48 #1-NixOS SMP PREEMPT_DYNAMIC Fri Sep 19 14:35:52 UTC 2025 x86_64 GNU/Linux Subsystem Modules: TypeScript What steps will reproduce the bug? const...
X Description: Version v22.8.0 Platform Linux samual-nixos 6.12.48 #1-NixOS SMP PREEMPT_DYNAMIC Fri Sep 19 14:35:52 UTC 2025 x86_64 GNU/Linux Subsystem Modules: TypeScript What steps will reproduce the bug? const...
Opengraph URL: https://github.com/nodejs/node/issues/60007
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bogus error \"Parenthesized expression cannot be empty\"","articleBody":"### Version\n\nv22.8.0\n\n### Platform\n\n```text\nLinux samual-nixos 6.12.48 #1-NixOS SMP PREEMPT_DYNAMIC Fri Sep 19 14:35:52 UTC 2025 x86_64 GNU/Linux\n```\n\n### Subsystem\n\nModules: TypeScript\n\n### What steps will reproduce the bug?\n\n```ts\nconst foo = (): (void) =\u003e {}\n```\n\nRun `node script.ts`\n\n### How often does it reproduce? Is there a required condition?\n\nalways\n\n### What is the expected behavior? Why is that the expected behavior?\n\nthis is perfectly valid type-strippable typescript so would expect `: (void)` is stripped away as expected and the script is interpreted as\n```js\nconst foo = () =\u003e {}\n```\n\n### What do you see instead?\n\n```\n❯ node script.ts\nnode:internal/modules/run_main:107\n triggerUncaughtException(\n ^\n\nfile:///home/[… SNIP …]/script.ts:1\nconst foo = (): (void) =\u003e {}\n ^^\n\nSyntaxError [ERR_INVALID_TYPESCRIPT_SYNTAX]: Parenthesized expression cannot be empty\n at parseTypeScript (node:internal/modules/typescript:72:36)\n at processTypeScriptCode (node:internal/modules/typescript:146:42)\n at stripTypeScriptModuleTypes (node:internal/modules/typescript:209:22)\n at ModuleLoader.\u003canonymous\u003e (node:internal/modules/esm/translators:645:16)\n at #translate (node:internal/modules/esm/loader:575:20)\n at afterLoad (node:internal/modules/esm/loader:625:29)\n at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:630:12)\n at #createModuleJob (node:internal/modules/esm/loader:654:36)\n at #getJobFromResolveResult (node:internal/modules/esm/loader:354:34)\n at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:319:41) {\n code: 'ERR_INVALID_TYPESCRIPT_SYNTAX'\n}\n\nNode.js v24.8.0\n```\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/samualtnorman","@type":"Person","name":"samualtnorman"},"datePublished":"2025-09-25T10:27:59.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/60007/node/issues/60007"}
| 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:6fafad6d-912a-75e4-3ab7-e2663dc2710b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C844:1A12B5:3CB61EC:54BBCEF:6A4F587D |
| html-safe-nonce | 8ea102b9301d94f739db5c1fecacc90d47b70ad1f176fc07415350d6338fe023 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODQ0OjFBMTJCNTozQ0I2MUVDOjU0QkJDRUY6NkE0RjU4N0QiLCJ2aXNpdG9yX2lkIjoiNzcyOTc4NzI0ODY2OTg0MTUzMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a2cb52473c0df7fd6937a7822e5757dbfd765521ec25e4f2456dbca18448fd8b |
| hovercard-subject-tag | issue:3453000882 |
| 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/60007/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a6c614be8d1943e908931887d6c2357cd428a9cb955f34f547171632f6a4cd0c/nodejs/node/issues/60007 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a6c614be8d1943e908931887d6c2357cd428a9cb955f34f547171632f6a4cd0c/nodejs/node/issues/60007 |
| og:image:alt | Version v22.8.0 Platform Linux samual-nixos 6.12.48 #1-NixOS SMP PREEMPT_DYNAMIC Fri Sep 19 14:35:52 UTC 2025 x86_64 GNU/Linux Subsystem Modules: TypeScript What steps will reproduce the bug? const... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | samualtnorman |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| 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 | b14b8c6d72fdb96ca48aba85dec94fe96ce5adbe |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width