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

Failed to load resource when trying the provided example.

Open JamalBelilet opened this issue 6 years ago • 6 comments

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)

JamalBelilet avatar Dec 09 '18 02:12 JamalBelilet

gl-matrix is a quick npm installation, but I'm curious where canvaskit.js is supposed to be coming from.

sanbornhilland avatar Dec 12 '18 20:12 sanbornhilland

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"

krispypen avatar Jan 02 '19 14:01 krispypen

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.

luigi-rosso avatar Jan 03 '19 17:01 luigi-rosso

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 avatar Feb 18 '19 03:02 jjjjim

@jjjjim They are using own custom canvaskit.js file, so simply pull latest commit and don't overwrite build/canvaskit.js from node_modules.

DamianEl avatar Feb 18 '19 09:02 DamianEl

i had some issue to run the example, i fixed it as #16

mhamri avatar Mar 18 '19 14:03 mhamri