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

imports including a wasm binary always recompile typescript after deno install #9749

Closed
andykais opened this issue Mar 10, 2021 · 1 comment

Comments

@andykais
Copy link

andykais commented Mar 10, 2021

possibly related to #5987, I have a simple script which uses a wasm binary file encoded as a base64 string inside a js file:

import Canvas from 'https://deno.land/x/canvas@v1.1.1/mod.ts'

after I install this as a script:

deno install -f canvas.ts

each time I run the file it recompiles the source code (despite no changes to the script canvas.ts).

canvas
Check file:///home/andrew/Code/development/sample-deno-canvas/canvas.ts

removing the canvas import (which includes a wasm file) stops the installed script from recompiling so I am assuming this has to do with having a wasm import.

Footnotes

a confusion I had while digging into this here is that this package https://deno.land/x/canvas@v1.1.1 does appear to read/fetch a wasm file:

let data = src.startsWith("http:") || src.startsWith("https:") ? await fetch(src).then(res => res.buffer()) : await Deno.readFile(src);

but this script appears to be able to use the canvas binary without specifying --allow-read or --allow-net

@andykais
Copy link
Author

disregard. This issue was apparent when I was running deno 1.7, upgrading to 1.8 appears to have made the problem go away

deno --version                         
deno 1.8.1 (release, x86_64-unknown-linux-gnu)
v8 9.0.257.3
typescript 4.2.2

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

1 participant