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

CompileErrror when initializing the wasm driver #84

Closed
adomasven opened this issue Nov 27, 2020 · 5 comments · Fixed by #85 or #108
Closed

CompileErrror when initializing the wasm driver #84

adomasven opened this issue Nov 27, 2020 · 5 comments · Fixed by #85 or #108
Labels
A-wasm Area: wasm package on npm I-bug Something isn't working

Comments

@adomasven
Copy link
Member

CompileError: wasm validation error: at offset 7591: can't import/export mutable globals in the MVP

I am getting the above error when initializing the wasm driver with the latest canary build.

@cormacrelf
Copy link
Collaborator

This is a runtime thing, which I could possibly fix by not running wasm-opt at all I think. This is in Zotero/Firefox ESR, right?

@adomasven
Copy link
Member Author

Yes. I'm using the same initialization code that worked 2 months ago.

@cormacrelf
Copy link
Collaborator

Ok, got it, pushing a new canary in a minute. It:

  • Disabled wasm-opt, which was emitting mutable globals
  • Pinned to Rust 1.43 on CI, I believe the rust compiler might have started emitting them on its own recently. Not that you should care, just for documenting this stuff.

I tweaked some things with the init code, not that different but altogether it will work once you npm install @citeproc-rs/wasm@canary again after that PR's merged. Here are my changes:

adomasven/zotero@citeproc-rs...cormacrelf:citeproc-rs

@cormacrelf
Copy link
Collaborator

Ah, no, this hasn't done it.

@cormacrelf
Copy link
Collaborator

Confirm, that fixed it. That's ESR life I suppose. You should see the breaking JS API changes to string ids making things not work, that's how you know it's real this time.

My next thing is to avoid rustwasm/wasm-bindgen#1963 and hopefully make sure #78 doesn't rear its head with a custom JS Result type (i.e. a slightly annoying but overall fine .unwrap() after each API call), so there's a little more pain to go with that, but then you'll also get the improved init/locales/dependent styles/style metadata stuff I've been working on.

cormacrelf added a commit that referenced this issue Apr 22, 2021
See #84; this fixes it and removes the version pin.
Also upgrades CI to rust stable 1.51
@cormacrelf cormacrelf added A-wasm Area: wasm package on npm I-bug Something isn't working labels Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-wasm Area: wasm package on npm I-bug Something isn't working
2 participants