luma.gl
luma.gl copied to clipboard
TS2304 without skipLibCheck: true
I am using the following dependencies in my angular application:
- @deck.gl/core: 8.8.4
- @deck.gl/geo-layers: 8.8.4
- @deck.gl/layers: 8.8.4
Since upgrading to Angular 14 I am getting the error described below.
When I disable the type checking in my tsconfig.json
file with the following line:
"skipLibCheck": true,
I am not getting the error. When I dig deeper into the package-lock.json
, I see that the package @deckgl/core is using @luma.gl/core:
"@deck.gl/core": {
"version": "8.8.4",
"resolved": "https://registry.npmjs.org/@deck.gl/core/-/core-8.8.4.tgz",
"integrity": "sha512-/EYtLZ7cQpTDHPAlThcIt9BjlPfVFMWaRmsT50ovFpecagBm9Uh5RAo1TsVqSDAad/y0CvZq1FNI/H+JidDPMQ==",
"requires": {
"@loaders.gl/core": "^3.2.5",
"@loaders.gl/images": "^3.2.5",
"@luma.gl/constants": "^8.5.16",
"@luma.gl/core": "^8.5.16",
"@math.gl/core": "^3.6.2",
"@math.gl/sun": "^3.6.2",
"@math.gl/web-mercator": "^3.6.2",
"@probe.gl/env": "^3.5.0",
"@probe.gl/log": "^3.5.0",
"@probe.gl/stats": "^3.5.0",
"gl-matrix": "^3.0.0",
"math.gl": "^3.6.2",
"mjolnir.js": "^2.7.0"
}
},
Actual Result
Error: node_modules/@luma.gl/gltools/src/context/context.d.ts:17:41 - error TS2304: Cannot find name 'OffscreenCanvas'.
17 canvas?: HTMLCanvasElement | string | OffscreenCanvas | null; // A canvas element or a canvas string id
Expected Result
No error TS2304 and no need to skip lib checks.
Reproduce Steps
Create a sample Angular application, use the three dependencies and try to compile the application.
This was addressed by https://github.com/visgl/luma.gl/pull/1649. It is included in @luma.gl/*
8.5.14 and above. Can you check your installed version?
This was addressed by #1649. It is included in
@luma.gl/*
8.5.14 and above. Can you check your installed version?
Based on my package-lock.json version 8.5.16
is installed:
"node_modules/@luma.gl/core": {
"version": "8.5.16",
"resolved": "https://registry.npmjs.org/@luma.gl/core/-/core-8.5.16.tgz",
"integrity": "sha512-w3goHMFEhQFlpoXXygFD6zaZvu4rYvMLfDXThpBMUYm8Y4k46UREFYhsV1aOe1aJlaolsRT/9J2fgSDXr0yA3w==",
"dependencies": {
"@babel/runtime": "^7.0.0",
"@luma.gl/constants": "8.5.16",
"@luma.gl/engine": "8.5.16",
"@luma.gl/gltools": "8.5.16",
"@luma.gl/shadertools": "8.5.16",
"@luma.gl/webgl": "8.5.16"
}
},
I am not an Angular user, though I cannot reproduce this in a React app. @types/offscreencanvas
is supposed to supply the OffscreenCanvas
definition.
I'm also using Angular and I had to add "offscreencanvas"
to the compilerOptions.types
array in tsconfig.app.json
.
Closing as it sounds like this has been resolved, but please let us know if that's not correct!