Skip to content

Commit

Permalink
Node 14.x did not like the import of canvas-renderer.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmester committed Jul 30, 2020
1 parent d17f744 commit 9fa1372
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/apis/toPng.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createCanvas } from "canvas-renderer";
import canvasRenderer from "canvas-renderer";
import { iconGenerator } from "../renderer/iconGenerator";
import { isValidHash, computeHash } from "../common/hashUtils";
import { getConfiguration } from "../common/configuration";
Expand All @@ -14,7 +14,7 @@ import { CanvasRenderer } from "../renderer/canvas/index";
* @returns {Buffer} PNG data
*/
export function toPng(hashOrValue, size, config) {
const canvas = createCanvas(size, size);
const canvas = canvasRenderer.createCanvas(size, size);
const ctx = canvas.getContext("2d");

iconGenerator(new CanvasRenderer(ctx, size),
Expand Down

0 comments on commit 9fa1372

Please sign in to comment.