IMI-eRnD-Be / wasm-run

Bundles and tooling for Rust WASM frontend application
MIT License
35 stars 3 forks source link

wasm-run has a problem compiling the project when importing a js file #68

Open szagi3891 opened 3 years ago

szagi3891 commented 3 years ago

I wanted to use this wasm_bindgen functionality for importing a js file https://github.com/rustwasm/wasm-bindgen/tree/master/examples/import_js

This is the file structure that wasm-run generated:

-rw-r--r--   1 grzegorzszeliga  staff    29303  4 lip 16:16 app.js
-rw-r--r--   1 grzegorzszeliga  staff  4123232  4 lip 16:16 app_bg.wasm
-rw-r--r--   1 grzegorzszeliga  staff      181  4 lip 16:16 index.html

The problem can be observed on this branch:

git clone git@github.com:vertigo-web/vertigo.git vertigo_bug_wasmrun
cd vertigo_bug_wasmrun
git checkout js_driver
./start_dev.sh 

then try open http://127.0.0.1:3000/ in browser.

An attempt to run the application ends with a 404 error on the resource: /snippets/vertigo-browserdriver-cf73457c3ed6503a/jsdriver/out/jsdriver.js

In a project where I used wasm-pack directly, I get this structure:

$ tree ./build/
./build/
├── app.js
├── app_bg.wasm
└── snippets
    └── vertigo-browserdriver-cf73457c3ed6503a
        └── jsdriver
            └── out
                └── jsdriver.js

it looks like wasm-run omits the generated "snippets" directory. Could you please help me with this problem?

cecton commented 2 years ago

Sorry for the late reply! I got the notifications turned off for some reason. Unfortunately I think this will be hard to reproduce on my own, can you check one of these solutions?

This is a known issue and related to #26.

@YohDeadfall was working on it at some point for wasm-run I don't know what's the status.

Unfortunately I'm planning to deprecated wasm-run in favor for xtask-wasm. That particular issue will be addressed there at some point. Maybe by @yozhgoor if @YohDeadfall doesn't feel motivated to continue.

YohDeadfall commented 2 years ago

The problem isn't in motivation, but unexpected lack of time (settling after the third relocation this year 🙂), so I'm not sure that will have enough time any time soon.

cecton commented 2 years ago

I know the feeling xD I'm delaying some things for months