TypeScript: TypeError: Cannot read property 'valueDeclaration' of undefined (continuation)

This is a continuation of https://github.com/microsoft/TypeScript/issues/34869

I’m still getting the error testing against v3.8.0-dev.20191205 Here is my stack trace (the first one is react-styleguidist)

Trace
    at withContext (node_modules/typescript/lib/typescript.js:36361:25)
    at Object.typeToTypeNode (node_modules/typescript/lib/typescript.js:36316:28)
    at typeToString (node_modules/typescript/lib/typescript.js:36283:40)
    at Object.typeToString (node_modules/typescript/lib/typescript.js:33355:24)
    at Parser.getDocgenType (node_modules/react-docgen-typescript/lib/parser.js:284:43)
    at node_modules/react-docgen-typescript/lib/parser.js:331:29
    at Array.forEach (<anonymous>)
    at Parser.getPropsInfo (node_modules/react-docgen-typescript/lib/parser.js:309:27)
    at Parser.getComponentInfo (node_modules/react-docgen-typescript/lib/parser.js:129:30)
    at node_modules/react-docgen-typescript/lib/parser.js:702:27
    at Array.map (<anonymous>)
    at node_modules/react-docgen-typescript/lib/parser.js:701:14
    at Array.reduce (<anonymous>)
    at parseWithProgramProvider (node_modules/react-docgen-typescript/lib/parser.js:694:10)
    at parse (node_modules/react-docgen-typescript/lib/parser.js:71:20)
    at Object.module.exports (node_modules/react-styleguidist/lib/loaders/props-loader.js:41:12)
 FAIL  Failed to compile

[internal]
INTERNAL ERROR: Cannot read property 'valueDeclaration' of undefined
stack trace:
TypeError: Cannot read property 'valueDeclaration' of undefined
    at getBaseConstructorTypeOfClass (node_modules/typescript/lib/typescript.js:40026:40)
    at serializeAsClass (node_modules/typescript/lib/typescript.js:38036:42)
    at serializeSymbolWorker (node_modules/typescript/lib/typescript.js:37770:29)
    at serializeSymbol (node_modules/typescript/lib/typescript.js:37711:38)
    at node_modules/typescript/lib/typescript.js:37686:25
    at Map.forEach (<anonymous>)
    at visitSymbolTable (node_modules/typescript/lib/typescript.js:37685:33)
    at symbolTableToDeclarationStatements (node_modules/typescript/lib/typescript.js:37556:17)
    at node_modules/typescript/lib/typescript.js:36340:106
    at withContext (node_modules/typescript/lib/typescript.js:36362:37)
error Command failed with exit code 1.

Related Issues: https://github.com/microsoft/TypeScript/issues/34869

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 19 (7 by maintainers)

Most upvoted comments

This was fixed in #38508.

I’ve narrowed down the issue and it appears when using fork-ts-checker-webpack-plugin with webpack. If I remove ForkTsCheckerWebpackPlugin from my webpack plugins list, build runs without errors. It happens both in dev (with webpack-dev-server) and production build (when using webpack right away).

@RyanCavanaugh thats what a few of us are trying to work out, this is happening on a large private repo which isn’t useful to you so the best I can provide is a stack trace.

From the last issue we are trying to narrow this down.