Flare-JS icon indicating copy to clipboard operation
Flare-JS copied to clipboard

ERROR TypeError: image.makeShader is not a function

Open pradipkachhadiya opened this issue 6 years ago • 1 comments

image

below line giving error from flare.min.js

makeImageShader(image) {
	return image.makeShader(CanvasKit.TileMode.Clamp, CanvasKit.TileMode.Clamp);
}

I had implemented code as like given in doc but Problem is that, jacko.flr which was given in demo and my own .flr file not working

Provide me solution or suggestion ASAP

pradipkachhadiya avatar Jun 11 '19 04:06 pradipkachhadiya

@pradipkachhadiya I was having this same issue. It seems like it is due to the canvaskit version located in the canvaskit folder here not being the proper version (that has .makeShader).

My solution was as follows:

  1. clone this repo
  2. npm install canvaskit-wasm
  3. go to /node_modules/canvaskit-wasm/bin/
  4. copy the canvaskit.js and canvaskit.wasm
  5. go to /canvaskit folder in the flare project and paste the new canvaskit files
  6. npm install
  7. npm start -- --watch

The newly built files should work properly for you

Colpan avatar Jun 12 '19 04:06 Colpan