Closed qbunia closed 2 years ago
Hi,
I`m using vuejs 2 with vue-cli, webpack and typescript. I imported fabric and fabricjs-psbrush as you mentioned in docs. My code:
import { PSBrush } from "@arch-inc/fabricjs-psbrush"; import { fabric } from "fabric"; this.canvas = new fabric.Canvas(document.getElementById("signatureCanvas"), { isDrawingMode: true, enablePointerEvents: true, //width: 600 - 2*15 - 2*1, height: 200, backgroundColor: "#fff" }); let brush = new fabric.PSBrush(this.canvas); brush.width = 30; brush.color = "#000"; this.canvas.freeDrawingBrush = brush;
I`m getting error: Uncaught TypeError: fabric__WEBPACK_IMPORTED_MODULE_2__.fabric.PSBrush is not a constructor
Hi @qbunia, would you simply use new PSBrush constructor instead of new fabric.PSBrush and check if it works?
new PSBrush
new fabric.PSBrush
@arcatdmz Thanks it worked, we can close the issuse.
Hi,
I`m using vuejs 2 with vue-cli, webpack and typescript. I imported fabric and fabricjs-psbrush as you mentioned in docs. My code:
I`m getting error: Uncaught TypeError: fabric__WEBPACK_IMPORTED_MODULE_2__.fabric.PSBrush is not a constructor