2d-inc / Flare-JS

Flare Javascript ES6 runtime with Canvas rendering.
https://flare.rive.app
MIT License
265 stars 59 forks source link

ERROR TypeError: image.makeShader is not a function #24

Open pradipkachhadiya opened 5 years ago

pradipkachhadiya commented 5 years ago

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

Colpan commented 5 years ago

@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