Skip to content

Commit b3dcb05

Browse files
committed
Fix crash when using community license.
1 parent 04bc782 commit b3dcb05

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// provides a virtual dom for lcjs to use
22
import { JSDOM } from 'jsdom'
33
// font support
4-
import { registerFont } from 'canvas'
4+
import { createCanvas, registerFont, Image } from 'canvas'
55
// headless-gl that implements WebGL in Node
66
import createContext from 'gl'
77
import { polyfill as rafPolyfill } from 'raf'
@@ -80,6 +80,10 @@ dom.window.fetch = function () {
8080
// suppress alert
8181
dom.window.alert = function () { }
8282

83+
dom.window.Image = Image
84+
85+
dom.window.lcjs_setup = createCanvas
86+
8387
/**
8488
* Monkey patch a function from LightningChart interface.
8589
* Inserts the default parameters that are different from browser environment.

0 commit comments

Comments
 (0)