We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
你好👋!
I'm trying to use this with nodeJS and node-canvas and typescript
import pkg from "spritejs" const { Scene, Sprite, ENV } = pkg
how do i access or use the polyfill?
const { polyfill } = require("../lib/platform/node-canvas")
I got as far as :
import pkg from "spritejs" const { Scene, Sprite, ENV } = pkg import { polyfill } from "./node-canvas-fill.js"
then in the node-canvas-fill.js I modified the import:
node-canvas-fill.js
import pkg from "node-canvas-webgl" const { nodeCanvasWebgl: _nodeCanvasWebgl } = pkg
but still getting these type of errors:
file:///Users/dc/dev/hacks/kbxt/server/src/services/node-canvas-fill.ts:70 ENV.createCanvas = _nodeCanvasWebgl.createCanvas ^ TypeError: Cannot read properties of undefined (reading 'createCanvas')
Is there an example using the library with typescript style imports that will work? even just for a plain 2D node-canvas, without the webGL effects?
Thanks!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
你好👋!
I'm trying to use this with nodeJS and node-canvas and typescript
how do i access or use the polyfill?
const { polyfill } = require("../lib/platform/node-canvas")
I got as far as :
then in the
node-canvas-fill.js
I modified the import:but still getting these type of errors:
Is there an example using the library with typescript style imports that will work?
even just for a plain 2D node-canvas, without the webGL effects?
Thanks!
The text was updated successfully, but these errors were encountered: