Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work unless canvaskit.wasm is a local file #1

Closed
mjrlowe opened this issue Nov 23, 2020 · 2 comments
Closed

Doesn't work unless canvaskit.wasm is a local file #1

mjrlowe opened this issue Nov 23, 2020 · 2 comments

Comments

@mjrlowe
Copy link

mjrlowe commented Nov 23, 2020

Nice work on this module! I had a go at using it but I quickly realised that you need to have the canvaskit.wasm file available locally (in the same directory as Canvas.MakeCanvas is called from), which is a little inconvenient.

I think this is unintentional--when you call Deno.readFileSync('./canvaskit.wasm') in lib.js, it reads the file relative to the user call, rather than the module.

@DjDeveloperr
Copy link
Owner

DjDeveloperr commented Nov 24, 2020

Yup, I'll make it download the wasm file when its imported if that's not locally present. I'll be doing this in a bit.
I was testing with it being in my project directory, so didn't notice 😅

Edit: Now it would attempt to download (& save) if not locally present.

@mjrlowe
Copy link
Author

mjrlowe commented Nov 24, 2020

Seems to work now, thanks.

Once Deno gets wasm imports (which probably won't be for a while) we should be able to do this without needing --allow-read or --allow-net to read the wasm file.

@mjrlowe mjrlowe closed this as completed Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants