-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptCrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputDomain: Declaration EmitThe issue relates to the emission of d.ts filesThe issue relates to the emission of d.ts filesFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
TypeScript Version: 3.7.2 and 3.8 beta
Expected behavior:
Newer typescript should not crash with existing code.
Actual behavior:
A specific combination of vuex and typescript 3.7.2 with allowJs: true and watch mode causes typescript to crashes with following stack trace:
$ ./node_modules/.bin/tsc --noEmit --watch
/var/app/web/node_modules/typescript/lib/tsc.js:78566
throw e;
^
TypeError: Cannot read property 'length' of undefined
at Object.find (/var/app/web/node_modules/typescript/lib/tsc.js:207:35)
at getDeclarationWithTypeAnnotation (/var/app/web/node_modules/typescript/lib/tsc.js:31333:31)
at isTypeRepresentableAsFunctionNamespaceMerge (/var/app/web/node_modules/typescript/lib/tsc.js:31275:26)
at serializeMaybeAliasAssignment (/var/app/web/node_modules/typescript/lib/tsc.js:31251:29)
at serializeVariableOrProperty (/var/app/web/node_modules/typescript/lib/tsc.js:31059:25)
at serializeSymbolWorker (/var/app/web/node_modules/typescript/lib/tsc.js:30927:25)
at serializeSymbol (/var/app/web/node_modules/typescript/lib/tsc.js:30894:38)
at /var/app/web/node_modules/typescript/lib/tsc.js:30875:25
at Map.forEach (<anonymous>)
at visitSymbolTable (/var/app/web/node_modules/typescript/lib/tsc.js:30874:33)
A simple js file like this will trigger above bug:
import {createNamespacedHelpers} from 'vuex'
const {mapState} = createNamespacedHelpers(STORE_NS)
export default {
computed: {
...mapState(['panels']) // <==== Bug is triggered with this line
}
}Reproduction repository is here: https://github.com/lephuongbg/typescript-bug-repro
Related Issues:
Not sure
jdeff and eduard-malakhov
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptCrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputDomain: Declaration EmitThe issue relates to the emission of d.ts filesThe issue relates to the emission of d.ts filesFix AvailableA PR has been opened for this issueA PR has been opened for this issue