-
Notifications
You must be signed in to change notification settings - Fork 178
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
Help With WASM Build #332
Comments
You may look at the playground and how it is done? @alvinhochun maybe you can give some pointers here as well? |
Just a a wild shot after some Googling: rustwasm/console_error_panic_hook#14 Another wild thought: Notice that all the |
Hi Pebaz. I should clarify beforehand that I have no experience with using While Rhai itself doesn't directly use I wonder if @not-fl3 can chime in? Side note: I wasn't able to set up and compile a project that mimics yours because not all the files are provided. |
It is a very common problem with Instant, the solution - use https://github.com/sebcrozet/instant#using-the-feature-now-without-stdweb-or-wasm-bindgen |
From what I can tell - Maybe it is possible to make Would be nice to use |
The best solution right now seems to be to add two new features, |
@Pebaz The latest drop in |
@schungx thank you so much I'll give this a shot as soon as possible! |
Nah, the
As far as I can tell, there is no other way around it if one wants to avoid both Luckily for @Pebaz, it looks like the |
Actually, from looking at the code it seems that the |
According to the documentation of |
OK, from code, it seems that
Therefore, @Pebaz you can try building for WASM without either |
yes, exactly, and that is how So I believe exposing instant's |
@schungx @alvinhochun @not-fl3 due to all your help I was able to successfully evaluate a Rhai script in the browser! I forked Rhai, re-exported Here is the change that was recommended by you guys! I believe that it is working due to Thank you so much guys! I feel that you all have gone above and beyond to help me and I appreciate it greatly! I'll definitely be evangelizing about Rhai and it's awesome maintainers! 🦀 |
But it would be really nice to use crates version of |
I definitely agree, if possible, it would be amazing to have the change that worked in Rhai itself rather than the custom fork! 🙂 |
From the code it doesn't seem the @Pebaz you can try pulling from this repo instead. It should work. |
My bad, I forgot about the |
I'm just starting a second game using Rhai and Macroquad, and I can't get a hello-world example to work in WASM:
Working WASM Build:
When using Rhai, here is the error it shows in the browser console:
I'm building the game using:
And serving it the same as without using Rhai:
The HTML to load the bundled game:
Rhai version: 0.9.10 (f32_float, only_i32, no_module, unchecked)
Rustc version: rustc 1.49.0-nightly (fd542592f 2020-10-26)
Any help on how to use Rhai with WASM would be appreciated!
The text was updated successfully, but these errors were encountered: