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

LinkError WebAssembly Instantiation, function import requires a callable #6

Closed
KamalOumghar-Capgemini opened this issue Mar 1, 2018 · 2 comments

Comments

@KamalOumghar-Capgemini
Copy link

I'm getting this strange error when trying to build the project in wasm32-unknown-unknown.
I've tried the way you recommended by following the steps:

  1. cargo build --release --target wasm32-unknown-unknown
  2. python post_build.py (this creates a rocket.wasm in the html folder)
  3. python -m SimpleHTTPServer
    Then, when i try to access localhost to see the result, i get directory listing instead of the game running. I don't know how to go directly to the gameplay.

I also tried the traditional way with:
cargo web start --target=wasm32-unknown-unknown
Then i opened http://localhost:8000/ but i get this error:

Uncaught (in promise) LinkError: WebAssembly Instantiation: Import #1 module="env" function="clear_screen" error: function import requires a callable
at

Do you know how to solve this issue?
Thanks in advance.

@aochagavia
Copy link
Owner

Where are you running the http server? You need the index.html file in the html directory.

Try the following:

cd html
python -m SimpleHTTPServer

Then everything should work

@KamalOumghar-Capgemini
Copy link
Author

Everything works fine now, thanks a lot!

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