API Extractor cannot find name OffscreenCanvas
See original GitHub issueHi, I’m trying to publish a TypeScript library npm package that includes Pixi, and Microsoft API Extractor is failing OffscreenCanvas
build:types
> tsc -p ./tsconfig.json --outDir build --declaration true && api-extractor run
node_modules/@pixi/core/index.d.ts:1543:45 - error TS2304: Cannot find name 'OffscreenCanvas'.
1543 static test(source: unknown): source is OffscreenCanvas | HTMLCanvasElement;
~~~~~~~~~~~~~~~
node_modules/@pixi/text/index.d.ts:272:41 - error TS2304: Cannot find name 'OffscreenCanvas'.
272 static _canvas: HTMLCanvasElement | OffscreenCanvas;
~~~~~~~~~~~~~~~
node_modules/@pixi/text/index.d.ts:273:49 - error TS2304: Cannot find name 'OffscreenCanvasRenderingContext2D'.
273 static _context: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@pixi/text/index.d.ts:300:105 - error TS2304: Cannot find name 'OffscreenCanvas'.
300 static measureText(text: string, style: TextStyle, wordWrap?: boolean, canvas?: HTMLCanvasElement | OffscreenCanvas): TextMetrics_2;
~~~~~~~~~~~~~~~
Think there’s some movement with offscreen canvas, maybe this has already been addressed.
FYI, or please advise if this seems in error.
Environment
- pixi.js: 6.2.2
- tslib: 2.3.1
- TypeScript: 4.5.5
- @microsoft/api-extractor: 7.19.4
- OS & Version: macOS Monterey, Apple M1 Pro
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Typescript Cannot find offscreencanvas - Stack Overflow
As per my comment to your question. This seems to be a TypeScript version problem, but the version in your package.json seems to...
Read more >Invoking API Extractor
The simplest way to invoke API Extractor is via the command-line. 1. Configure the TypeScript compiler for your project. For this tutorial, suppose...
Read more >Safari Technology Preview Release Notes - Apple Developer
Preview the new type of phishing-resistant credential that makes signing in to websites safer and easier. Available through Safari's WebAuthn platform ...
Read more >cannot find name offscreencanvas, error ts2304
Method 1: Checking if OffscreenCanvas exists: The typeof operator is used to return a string of the type of the operand. The OffscreenCanvas...
Read more >@vladmandic/face-api - npm Package Health Analysis | Snyk
Learn more about @vladmandic/face-api: package health score, popularity, ... period of the last 12 months, excluding weekends and known missing data points.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve stubbed my toe on this too. If you add
@types/offscreencanvas
to your project it should fix. But we should add this as a dependency.I did now, thanks! It is here.