No such file or directory when loading image using node-canvas

Viewed 181

Above is the code I'm attempting to run, for some reason the 'no such file or directory' error is thrown but i know for a fact the image is there. I can't see anything wrong with the current code.

async generateWishBackground(ctx) {
  const wishBackground = loadImage('./image.jpg');

  ctx.drawImage(wishBackground, 0, 0, ctx.canvas.width, ctx.canvas.height);
}
0 Answers
Related