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

Error importing rust crate #3485

Closed
jgall opened this issue Sep 2, 2019 · 3 comments
Closed

Error importing rust crate #3485

jgall opened this issue Sep 2, 2019 · 3 comments

Comments

@jgall
Copy link

jgall commented Sep 2, 2019

🐛 bug report

Importing Rust code by doing import {my_fun} from 'my_rust.rs is working fine for me, however, when I try to import a crate I've written via import {my_fun} from './my_crate/src/lib.rs' as seen here the build works however, in the javascript console in Firefox I get the following error:

TypeError: second argument must be an object

🎛 Configuration (.babelrc, package.json, cli command)

configuration and project visible at https://github.com/jgall/parcel_issue

🤔 Expected Behavior

The function should be imported properly.

😯 Current Behavior

I get an error in the console instead of loading a function from Rust.

💻 Code Sample

I wrote up a quick example that shows the bug (at least on my laptop it reproduces 100% of the time)
https://github.com/jgall/parcel_issue

🌍 Your Environment

Software Version(s)
Parcel 1.12.3
Node v11.14.0
npm 6.9.0
Operating System 10.15 Beta (19A546d)
@darkship
Copy link

darkship commented Oct 15, 2019

In chrome :

Uncaught (in promise) TypeError: WebAssembly.instantiate(): Imports argument must be present and must be an object

On Firefox
it fails on WebAssembly.instantiateStreaming(res); in node_src/builtins/loaders/browser/wasm-loader.js

Edit: wasm_bindgen seems to be unsuported #647

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.

@github-actions github-actions bot added the Stale Inactive issues label Apr 16, 2020
@github-actions github-actions bot closed this as completed May 1, 2020
@hebronwatson
Copy link

This is still an issue

@github-actions github-actions bot removed the Stale Inactive issues label Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants