Skip to content

Commit 212af81

Browse files
authored
fix canvas import (#631)
1 parent b6e2d10 commit 212af81

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/serve_rendered.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import url from 'url';
77
import util from 'util';
88
import zlib from 'zlib';
99
import sharp from 'sharp'; // sharp has to be required before node-canvas. see https://github.com/lovell/sharp/issues/371
10-
import pkg from 'canvas';
10+
import {createCanvas, Image} from 'canvas';
1111
import clone from 'clone';
1212
import Color from 'color';
1313
import express from 'express';
@@ -22,7 +22,6 @@ import {getFontsPbf, getTileUrls, fixTileJSONCenter} from './utils.js';
2222
const FLOAT_PATTERN = '[+-]?(?:\\d+|\\d+\.?\\d+)';
2323
const httpTester = /^(http(s)?:)?\/\//;
2424

25-
const {createCanvas, Image} = pkg;
2625
const mercator = new SphericalMercator();
2726
const getScale = (scale) => (scale || '@1x').slice(1, 2) | 0;
2827

0 commit comments

Comments
 (0)