-
Notifications
You must be signed in to change notification settings - Fork 45
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
apollo_compiler
encounters runtime error in wasm usages
#844
Comments
After digging around a bit more, it became apparent to me the issue was in the usage of the The
I'm not super familiar with the rust/wasm ecosystem, deps, and features of deps yet so this took me awhile to arrive at the solution. Is this something worth documenting in our README, perhaps? This issue is probably fine to close, but I will leave it up to you folks in case there's a better solution than the one I've arrived at that y'all have in mind. |
Instant is not in use anymore in the latest 1.0 betas. New code should use the 1.0 betas rather than 0.11.x! apollo-compiler = "=1.0.0-beta.14" |
Description
I tried using
apollo_compiler
in a wasm context. My Rust app compiles successfully but encounters a "Module not found" error (seemingly at thewasm-pack
step being handled by webpack, though that's not entirely apparent to me).I mention this in the repro README, but it seems
Instant::now
is unavailable in wasm and somewhere in the dependency tree ofapollo_compiler
it's being used. Unfortunately this isn't caught as part of building for wasm, else this error would turn up in our wasm build step in CI.Also in the README but worth referencing here, this thread is highly relevant.
Steps to reproduce
Clone this repo:
https://github.com/trevor-scheer/compiler-wasm-reproduction
Reproduction steps are at the bottom of the README.
The initial commit comes from this handy template. Things run as expected from that commit. The second commit shows my diff which introduces
apollo_compiler
usage and the error mentioned in the README occurs.Expected result
I expect to be able to use
apollo_compiler
in a wasm context without module resolution errors.Actual result
Module resolution error:
Environment
Happy to provide more specifics if needed, but I don't think this is env specific
zsh
apollo-rs
crate:apollo_compiler
0.11.3
The text was updated successfully, but these errors were encountered: