Closed
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