rustwasm / wasm-bindgen

Facilitating high-level interactions between Wasm modules and JavaScript
https://rustwasm.github.io/docs/wasm-bindgen/
Apache License 2.0
7.84k stars 1.08k forks source link

Upgrading from 0.2.93 to 0.2.95 does not emit JS code with link_to! macro #4247

Closed noname0310 closed 3 weeks ago

noname0310 commented 3 weeks ago

Describe the Bug

I'm using wasm-bindgen-rayon which has the following statement to emit a worker.js file.

#[allow(unused_must_use)]
fn _ensure_worker_emitted() {
    // Just ensure that the worker is emitted into the output folder, but don't actually use the URL.
    wasm_bindgen::link_to!(module = "/src/workerHelpers.worker.js");
}

https://github.com/RReverser/wasm-bindgen-rayon/blob/main/src/lib.rs#L56-L60

The problem is that since wasm-bindgen 0.2.95 this syntax doesn't work at all.

Steps to Reproduce

Requires sccache, clang, and llvm

  1. Clone https://github.com/noname0310/babylon-bulletphysics/tree/d00bd56412e63448822572f729669e243f3d2170
  2. Type the following commands npm i, `npm run wasm-build-all
  3. Goto ./src/wasm/md/
  4. See error

Expected Behavior

The file structure generated by a project using wasm-bindgen-rayon should look like this

image

Actual Behavior

However, since worker.js is not emitted as of 0.2.95, it is generated like this.

image

RunDevelopment commented 3 weeks ago

I think this is a duplicate of #4233.

noname0310 commented 3 weeks ago

This seems to be a duplicate. closing the issue.