I've got a TS bug and I think it's because I'm stupid
however I need help to determine the nature of the stupid. I'm using vega.js with Angular 7. It seems TypeScript 3.1.6 is most recent version of TS that Angular loves, so I'm using that. As for the versions of other things, I've tried multiple versions of Vega, so I think the problem is with me rather than with Vega. I'm getting this compile error:
ERROR in node_modules/vega-lite/build/src/log.d.ts(23,5): error TS2416: Property 'level' in type 'LocalLogger' is not assignable to the same property in base type 'LoggerInterface'. Type '() => this' is not assignable to type '(_: number) => number | LoggerInterface'. Type 'this' is not assignable to type 'number | LoggerInterface'. Type 'LocalLogger' is not assignable to type 'number | LoggerInterface'. Type 'LocalLogger' is not assignable to type 'LoggerInterface'. Type 'this' is not assignable to type 'LoggerInterface'. Type 'LocalLogger' is not assignable to type 'LoggerInterface'. Property 'error' is missing in type 'LocalLogger'. node_modules/vega-lite/build/src/log.d.ts(24,5): error TS2416: Property 'warn' in type 'LocalLogger' is not assignable to the same property in base type 'LoggerInterface'. Type '(...args: any[]) => this' is not assignable to type '(...args: any[]) => LoggerInterface'. Type 'this' is not assignable to type 'LoggerInterface'. node_modules/vega-lite/build/src/log.d.ts(25,5): error TS2416: Property 'info' in type 'LocalLogger' is not assignable to the same property in base type 'LoggerInterface'. Type '(...args: any[]) => this' is not assignable to type '(...args: any[]) => LoggerInterface'. Type 'this' is not assignable to type 'LoggerInterface'. node_modules/vega-lite/build/src/log.d.ts(26,5): error TS2416: Property 'debug' in type 'LocalLogger' is not assignable to the same property in base type 'LoggerInterface'. Type '(...args: any[]) => this' is not assignable to type '(...args: any[]) => LoggerInterface'. Type 'this' is not assignable to type 'LoggerInterface'.
The code from vega-lite is here: https://github.com/vega/vega-lite/blame/master/src/log.ts . Git blame shows the definition of level is 2 years old.
LoggerInterface is from vega-util, and the code for it is here: https://github.com/vega/vega-util/blame/master/src/logger.js , and that's 3 years old.
I can find no mention of this problem in Google, and I expect somebody might have noticed in the last 2 years that Vega doesn't compile... which suggests that this problem is my own fault. Where do I look?
I've tried various things in tsconfig.json, but here's what it currently is:
{ "compileOnSave": false, "compilerOptions": { "baseUrl": "./", "outDir": "./dist/out-tsc", "sourceMap": true, "declaration": true, "module": "es2015", "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, "allowSyntheticDefaultImports": true, "suppressImplicitAnyIndexErrors": true, "esModuleInterop": true, "noEmitOnError": true, "importHelpers": true, "resolveJsonModule": true, "target": "es5", "typeRoots": [ "node_modules/@types" ], "lib": [ "es2017", "dom" ] } }
Is there something blindingly wrong? Please help, I don't have a good idea about what to try next.
Edit: This has been resolved, thank you. I still don't get why it happened, but now I understand the process to go through to resolve such issues.