TypeScript Version: 3.7.5
Code
When I add
in my project with Webpack and run a command to build it or start watching for changes it fails with error
TypeError: Cannot read property 'heritageClauses' of undefined
at getClassExtendsHeritageElement (/Users/alex/WebstormProjects/rete-tracker/node_modules/typescript/lib/typescript.js:12354:53)
at Object.getEffectiveBaseTypeNode (/Users/alex/WebstormProjects/rete-tracker/node_modules/typescript/lib/typescript.js:12342:24)
at getBaseConstructorTypeOfClass (/Users/alex/WebstormProjects/rete-tracker/node_modules/typescript/lib/typescript.js:40022:35)
at serializeAsClass (/Users/alex/WebstormProjects/rete-tracker/node_modules/typescript/lib/typescript.js:38029:42)
at serializeSymbolWorker (/Users/alex/WebstormProjects/rete-tracker/node_modules/typescript/lib/typescript.js:37763:29)
at serializeSymbol (/Users/alex/WebstormProjects/rete-tracker/node_modules/typescript/lib/typescript.js:37704:38)
at /Users/alex/WebstormProjects/rete-tracker/node_modules/typescript/lib/typescript.js:37679:25
at Map.forEach (<anonymous>)
at visitSymbolTable (/Users/alex/WebstormProjects/rete-tracker/node_modules/typescript/lib/typescript.js:37678:33)
at symbolTableToDeclarationStatements (/Users/alex/WebstormProjects/rete-tracker/node_modules/typescript/lib/typescript.js:37549:17)
at /Users/alex/WebstormProjects/rete-tracker/node_modules/typescript/lib/typescript.js:36346:106
at withContext (/Users/alex/WebstormProjects/rete-tracker/node_modules/typescript/lib/typescript.js:36367:37)
at Object.symbolTableToDeclarationStatements (/Users/alex/WebstormProjects/rete-tracker/node_modules/typescript/lib/typescript.js:36346:28)
at Object.getDeclarationStatementsForSourceFile (/Users/alex/WebstormProjects/rete-tracker/node_modules/typescript/lib/typescript.js:64426:60)
at transformDeclarationsForJS (/Users/alex/WebstormProjects/rete-tracker/node_modules/typescript/lib/typescript.js:88037:35)
at transformRoot (/Users/alex/WebstormProjects/rete-tracker/node_modules/typescript/lib/typescript.js:88114:57)
But it compiles just fine if add this line later when Webpack is already watching for changes in files.
whatwg-fetch has the following in its package.json:
"main": "./dist/fetch.umd.js",
"module": "./fetch.js",
The problem occurs when the module export picked by default, when I point to the script exported as main with
import 'whatwg-fetch/dist/fetch.umd';
everything works fine.
I have the following tsconfig:
{
"compilerOptions": {
"target": "es2018",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"outDir": "dist/core",
"noEmitOnError": true,
"sourceMap": true,
"baseUrl": "src",
"strictNullChecks": true,
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"downlevelIteration": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "commonjs",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"typeRoots": [
"./node_modules/@types",
"./src/declarations"
]
},
"include": [
"src"
]
}
Related Issues: #10268
TypeScript Version: 3.7.5
Code
When I add
in my project with Webpack and run a command to build it or start watching for changes it fails with error
But it compiles just fine if add this line later when Webpack is already watching for changes in files.
whatwg-fetchhas the following in itspackage.json:The problem occurs when the module export picked by default, when I point to the script exported as main with
everything works fine.
I have the following tsconfig:
Related Issues: #10268