Flare-JS
Flare-JS copied to clipboard
Failed to load resource when trying the provided example.
gl-matrix.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND example.js:7 Uncaught ReferenceError: vec2 is not defined at example.js:7 at example.js:179 example.html:24 Uncaught ReferenceError: FlareExample is not defined at onLoad (example.html:24) at onload (example.html:60)
gl-matrix
is a quick npm installation, but I'm curious where canvaskit.js
is supposed to be coming from.
Looks like canvaskit-wasm is made available some days ago via npm...
So to get the example running I had to:
npm install gl-matrix canvaskit-wasm
npm start --
cp node_modules/canvaskit-wasm/bin/canvaskit.* build/
cp node_modules/gl-matrix/dist/gl-matrix.js build/
wget "https://github.com/2d-inc/Flare-Flutter/raw/master/example/simple/assets/Filip.flr" -O example/Filip.flr
sed -i '' 's/ball\.flj/Filip\.flr/g' example/example.html
http-server ##npm install -g http-server to install it
open "http://localhost:8080/example/example.html"
Or when you start from the canvaskit branch:
npm install canvaskit-wasm
npm start --
cp node_modules/canvaskit-wasm/bin/canvaskit.* build/
cp node_modules/gl-matrix/dist/gl-matrix.js build/
http-server ##npm install -g http-server to install it
open "http://localhost:8080/example/example.html"
Sorry for the oversight here, we were compiling it manually from the Skia repository, but like you saw it's now generally available. We've updated the instructions in the readme to help get people started. We recognize we still have a lot of documenting to do.
I just tried to load the provided example under the guidance of @krispypen , but I faied, the error message was '_RenderPath.rewind is not a function', can you load the example?thank you
@jjjjim They are using own custom canvaskit.js
file, so simply pull latest commit and don't overwrite build/canvaskit.js
from node_modules.
i had some issue to run the example, i fixed it as #16