Closed zyiang1928 closed 4 years ago
What is the environment (browser, node.js) and which module definition are you using (UMD, AMD, requirejs, CommonJS, or ESM)?
And not less importantly, what's Canvas
defined as, and what is your canvas-constructor version?
Actually, reading your code, you're using discord.js, so you're 99.99% likely to be using Node.js with CJS.
I also see that Canvas
is defined as the library's class, not the library's exports.
resolveImage
is not a static method on Canvas
, it's a separate export. To fix this, you need to do this:
const { Canvas, resolveImage } = require('canvas-constructor');
Oh okay thanks
Anyone can help me? This is the code that I made