Title: "Debug Failure. False expression." when using default export from js file · Issue #60692 · microsoft/TypeScript · GitHub
Open Graph Title: "Debug Failure. False expression." when using default export from js file · Issue #60692 · microsoft/TypeScript
X Title: "Debug Failure. False expression." when using default export from js file · Issue #60692 · microsoft/TypeScript
Description: 🔎 Search Terms debug failure false expression export default composite allowjs js 🕗 Version & Regression Information This changed between versions 5.6.2 and 5.7.2 ⏯ Playground Link https://stackblitz.com/edit/ts-false-expression-tqxlxy?f...
Open Graph Description: 🔎 Search Terms debug failure false expression export default composite allowjs js 🕗 Version & Regression Information This changed between versions 5.6.2 and 5.7.2 ⏯ Playground Link https://stackbli...
X Description: 🔎 Search Terms debug failure false expression export default composite allowjs js 🕗 Version & Regression Information This changed between versions 5.6.2 and 5.7.2 ⏯ Playground Link https://stac...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/60692
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"\"Debug Failure. False expression.\" when using default export from js file","articleBody":"### 🔎 Search Terms\n\ndebug failure false expression export default composite allowjs js\n\n### 🕗 Version & Regression Information\n\n- This changed between versions 5.6.2 and 5.7.2\n\n### ⏯ Playground Link\n\nhttps://stackblitz.com/edit/ts-false-expression-tqxlxy?file=tsconfig.json,package.json\n\n### 💻 Code\n\n```js\n// In a JS file\nexport default console; \n```\nThe error also seems to happen if you replace `console` with anything from `globalThis` (screen, scroll, fetch, etc.)\n\nTSConfig.json:\n```json\n \"composite\": true,\n \"allowJs\": true,\n```\n\n### 🙁 Actual behavior\n\nRunning tsc results in this error:\n```\n> tsc\n\nError: Debug Failure. False expression.\n at Object.isUndefinedIdentifierExpression (/home/projects/ts-false-expression-tqxlxy/node_modules/typescript/lib/_tsc.js:50211:15)\n at typeFromExpression (/home/projects/ts-false-expression-tqxlxy/node_modules/typescript/lib/_tsc.js:132377:22)\n at serializeTypeOfExpression (/home/projects/ts-false-expression-tqxlxy/node_modules/typescript/lib/_tsc.js:132107:20)\n at Object.serializeTypeOfDeclaration (/home/projects/ts-false-expression-tqxlxy/node_modules/typescript/lib/_tsc.js:132131:16)\n at serializeTypeForDeclaration (/home/projects/ts-false-expression-tqxlxy/node_modules/typescript/lib/_tsc.js:52640:41)\n at serializeMaybeAliasAssignment (/home/projects/ts-false-expression-tqxlxy/node_modules/typescript/lib/_tsc.js:54015:19)\n at serializeAsAlias (/home/projects/ts-false-expression-tqxlxy/node_modules/typescript/lib/_tsc.js:53899:13)\n at serializeSymbolWorker (/home/projects/ts-false-expression-tqxlxy/node_modules/typescript/lib/_tsc.js:53255:11)\n at serializeSymbol (/home/projects/ts-false-expression-tqxlxy/node_modules/typescript/lib/_tsc.js:53119:11)\n at eval (/home/projects/ts-false-expression-tqxlxy/node_modules/typescript/lib/_tsc.js:53089:11)\n\nNode.js v18.20.3\n```\n\n### 🙂 Expected behavior\n\nNo Error :-)\n\n### Additional information about the issue\n\nI see this both locally and in stackblitz. I don't know how to reproduce in the playground because it only seems to happen when using a JS file.\n\nThis does not cause an error:\n```\nconst thing = console;\nexport default thing;\n```","author":{"url":"https://github.com/literalpie","@type":"Person","name":"literalpie"},"datePublished":"2024-12-05T14:24:59Z","url":"https://github.com/microsoft/TypeScript/issues/60692"}
| 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:809d3961-5459-9c10-7906-79bc81ba7be5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BF9E:1050BD:E5B562:1309FEA:6B01D42D |
| html-safe-nonce | f45775dd4665033292c9a041e4daff88729f5b7746aff1f65a8e627e1b9a3d4c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRjlFOjEwNTBCRDpFNUI1NjI6MTMwOUZFQTo2QjAxRDQyRCIsInZpc2l0b3JfaWQiOiIxMzU2NDA2NzU3NTU1MDMzMTMzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c5f128877f7cbac32406f2a6a5097ffe9e5d8e69e02867de3b5fff0780a57584 |
| hovercard-subject-tag | issue:2720560787 |
| 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/microsoft/TypeScript/60692/issue_layout |
| twitter:image | https://opengraph.githubassets.com/29eadbe488eadc124f918c4319a4d059ed2f42cc7bd8e08a4033875a91e3c1d7/microsoft/TypeScript/issues/60692 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/29eadbe488eadc124f918c4319a4d059ed2f42cc7bd8e08a4033875a91e3c1d7/microsoft/TypeScript/issues/60692 |
| og:image:alt | 🔎 Search Terms debug failure false expression export default composite allowjs js 🕗 Version & Regression Information This changed between versions 5.6.2 and 5.7.2 ⏯ Playground Link https://stackbli... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | literalpie |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width