tsickle: Cannot read property 'toJSON' of undefined

I have a project here that uses ngc. However, when I compile the project using TS 2.2.2 and the command ./node_modules/.bin/ngc -p src/lib/tsconfig.json I get the following error…

TypeError: Cannot read property 'toJSON' of undefined
    at Object.sourceMapGeneratorToConsumer (.../node_modules/tsickle/build/src/source_map_utils.js:65:42)
    at TsickleCompilerHost.combineSourceMaps (.../flex-layout/node_modules/tsickle/build/src/tsickle_compiler_host.js:167:74)
    at TsickleCompilerHost.writeFile (.../flex-layout/node_modules/tsickle/build/src/tsickle_compiler_host.js:111:28)
    at Object.writeFile (.../flex-layout/node_modules/typescript/lib/typescript.js:64240:132)
    at Object.writeFile (.../flex-layout/node_modules/typescript/lib/typescript.js:9020:14)
    at printSourceFileOrBundle (.../flex-layout/node_modules/typescript/lib/typescript.js:61197:20)
    at emitSourceFileOrBundle (.../flex-layout/node_modules/typescript/lib/typescript.js:61155:21)
    at Object.forEachEmittedFile (.../flex-layout/node_modules/typescript/lib/typescript.js:8986:17)
    at Object.emitFiles (.../flex-layout/node_modules/typescript/lib/typescript.js:61137:12)
    at emitWorker (.../flex-layout/node_modules/typescript/lib/typescript.js:64294:33)

I would expect that this is probably related to using TS 2.2

https://github.com/angular/tsickle/pull/447

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 17 (6 by maintainers)

Most upvoted comments

@jrgleason @ThomasBurleson It looks like the issue is that you specify a maproot of “” in your tsconfig. Can you remove that setting?