Skip to content

wasm-bindgen not found during webpack chaining #36

@Zireael

Description

@Zireael

Hi I'm getting error (looks like it can't find wasm-bindgen):

image

I have wasm-bindgen installed on my system (can compile .rs into .wasm with [wasm-pack build]).

I use Vue cli, not sure if that matters (it's just a wrapper for webpack). Would you have any ideas to solve this? I can use .wasm files built with wasm-pack, but can't .rs from webpack loader chaining.

Vue Webpack chain config:

    config.module
      .rule("Rust")
      .test(/\.rs$/)
      .use("wasm-loader")
      .loader("rust-native-wasm-loader")
      .options({
        release: true
      });

.rs import:

import loadAdd from "@/js/wasm/hello_world/hello_world.rs";

loadAdd().then(result => {
  const add = result.instance.exports["add"];
  console.log("return value was", add(2, 3));
});

I tried using the [wasm-bindgen experimental support] webpack config provided on your page a well, but getting same error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions