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

wasm: Uncaught TypeError: Error resolving module specifier “env” #34

Closed
schell opened this issue Aug 30, 2022 · 2 comments
Closed

Comments

@schell
Copy link

schell commented Aug 30, 2022

I've run into an interesting bug where attempting to run a wasm32-compiled program with fastrand in it gives this error in the console:

Uncaught TypeError: Error resolving module specifier “env”. Relative module specifiers must start with “./”, “../” or “/”.

I'm using fastrand = "1.8.0"

I encountered this after adding futures-lite to my project, which depends on fastrand. rustwasm/wasm-bindgen#2215 explains a few reasons why this error might pop up.

I got around this problem by using futures_lite::StreamExt::or instead of futures_lite::StreamExt::race. race uses fastrand::bool, whereas or does not.

@taiki-e
Copy link
Collaborator

taiki-e commented Aug 30, 2022

Duplicate of #27

@taiki-e taiki-e marked this as a duplicate of #27 Aug 30, 2022
@taiki-e taiki-e closed this as completed Aug 30, 2022
@notgull
Copy link
Member

notgull commented Aug 30, 2022

Note that if you compile and run the program in a WASI environment, it should all work out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants