-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiler crash on exports.fn
pattern
#42350
Comments
Sorry, I think it really should be more urgent than It's not an obscure bug, TypeScript currently crashes on CodeMirror -- arguably the most basic core library on the web, everyone on here touches it daily in Sources and Console tab of DevTools. |
Is the regression information accurate? 4.1 came out two months ago and this is the first we've heard of it, which would indicate this isn't as critical as you're describing. |
This required pinning typescript to v4.0.5 due to microsoft/TypeScript#42350. I don't yet understand why this bug manifested with pnpm and not with yarn, but it may get fixed in TS 4.3.0 or earlier.
This required pinning typescript to v4.0.5 due to microsoft/TypeScript#42350. I don't yet understand why this bug manifested with pnpm and not with yarn, but it may get fixed in TS 4.3.0 or earlier.
This required pinning typescript to v4.0.5 due to microsoft/TypeScript#42350. I don't yet understand why this bug manifested with pnpm and not with yarn, but it may get fixed in TS 4.3.0 or earlier.
This required pinning typescript to v4.0.5 due to microsoft/TypeScript#42350. I don't yet understand why this bug manifested with pnpm and not with yarn, but it may get fixed in TS 4.3.0 or earlier.
I don't have much to contribute in terms of helping identify why this happens, but I ran into it while trying to move from yarn to pnpm: votingworks/vxsuite#146. Downgrading to TS 4.0.5 fixed it. |
…tPropertyOfType` e350c35 (microsoft#40228) introduced a subtle bug: it switched the flags to an alias, dropping `SymbolFlags.Property` --- and that makes `symbolIsValue()` get to the `resolveAlias(symbol)` call, which leads to `getPropertyOfType()` with`resolved.callSignatures`+`constructSignatures` being `undefined`. So initialize them in `setStructuredTypeMembers` before calling `getNamedMembers()`. Fixes microsoft#42350
…tPropertyOfType` e350c35 (microsoft#40228) introduced a subtle bug: it switched the flags to an alias, dropping `SymbolFlags.Property` --- and that makes `symbolIsValue()` get to the `resolveAlias(symbol)` call, which leads to `getPropertyOfType()` with`resolved.callSignatures`+`constructSignatures` being `undefined`. So initialize them in `setStructuredTypeMembers` before calling `getNamedMembers()`. Fixes microsoft#42350
…tPropertyOfType` e350c35 (#40228) introduced a subtle bug: it switched the flags to an alias, dropping `SymbolFlags.Property` --- and that makes `symbolIsValue()` get to the `resolveAlias(symbol)` call, which leads to `getPropertyOfType()` with`resolved.callSignatures`+`constructSignatures` being `undefined`. So initialize them in `setStructuredTypeMembers` before calling `getNamedMembers()`. Fixes #42350
Already fixed, but repro at https://github.com/microsoft/tsserverfuzzer/issues/299 |
Component commits: ed26816 Avoid getting undefined `callSignatures`/`constructSignatures` in `getPropertyOfType` e350c35 (microsoft#40228) introduced a subtle bug: it switched the flags to an alias, dropping `SymbolFlags.Property` --- and that makes `symbolIsValue()` get to the `resolveAlias(symbol)` call, which leads to `getPropertyOfType()` with`resolved.callSignatures`+`constructSignatures` being `undefined`. So initialize them in `setStructuredTypeMembers` before calling `getNamedMembers()`. Fixes microsoft#42350
Component commits: ed26816 Avoid getting undefined `callSignatures`/`constructSignatures` in `getPropertyOfType` e350c35 (#40228) introduced a subtle bug: it switched the flags to an alias, dropping `SymbolFlags.Property` --- and that makes `symbolIsValue()` get to the `resolveAlias(symbol)` call, which leads to `getPropertyOfType()` with`resolved.callSignatures`+`constructSignatures` being `undefined`. So initialize them in `setStructuredTypeMembers` before calling `getNamedMembers()`. Fixes #42350 Co-authored-by: Eli Barzilay <eli@barzilay.org>
Bug Report
🔎 Search Terms
🕗 Version & Regression Information
⏯ Playground Link
2-line example
💻 Code
🙁 Actual behavior
Crashing:
This is running
tsc.js
with:node --inspect-brk node_modules\typescript\lib\tsc.js repor.js --out repor.out.js --allowJs
and some state in context:🙂 Expected behavior
Transpile, don't crash. Can produce errors/warnings, but not crash.
Background
This happened when I tried to run TypeScript over the latest CodeMirror, and stumbled upon the file runmode.node.js (see on unpkg). Then, simplified to the minimal reproduction case.
As you can see from the caught error above,
resolved.callSignatures
isundefined
and that causes throw here.I assume this happens because
exports
isn't treated as a normal global variable even in a variable position. But in variable position it should be treated as a variable.Note: can't simplify any more, both lines are necessary. Which means it's not just bad handling of
exports
, but something more conspiratorial.The text was updated successfully, but these errors were encountered: