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

emit requires network access even when using a load function #81

Closed
not-my-profile opened this issue Nov 13, 2022 · 3 comments
Closed

Comments

@not-my-profile
Copy link

import { emit } from 'https://deno.land/x/emit/mod.ts';

let code = (await emit('', {load: async (_) => {
    return {kind: 'module', specifier: 'file:///_.ts', content: 'let x: number = 33'}
}}))['file:///_.ts'];

console.log(code);

If you save this code as demo.ts and run it, you get:

$ deno run --allow-read foo.ts 
⚠️  ┌ Deno requests network access to "deno.land".
   ├ Requested by `Deno.permissions.query()` API
   ├ Run again with --allow-net to bypass this prompt.
   └ Allow? [y/n] (y = yes, allow; n = no, deny)
@jollytoad
Copy link

Maybe related to this... denoland/deno_cache_dir#20

@Blocksnmore
Copy link

This request could also be from emit trying to download the wasm and caching it so that you can actually use the library

@dsherret
Copy link
Member

dsherret commented May 4, 2023

This request could also be from emit trying to download the wasm and caching it so that you can actually use the library

Yes, it's necessary to download the wasm file from deno.land/x. Follow denoland/deno#2552 for how this could be improved.

@dsherret dsherret closed this as not planned Won't fix, can't repro, duplicate, stale May 4, 2023
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

4 participants