cloudflare / cloudflare/rustwasm-worker-template
Could not resolve "./index_bg.wasm"
- Dominant language
- Rust
- Stars
- 386
- Forks
- 64
- PR merge metrics
- No merged PRs in 30d
Description
using wrangler 3.4.0, wasm-pack 0.12.1, and this template.
```
✘ [ERROR] Could not resolve "./index_bg.wasm"
index_bg.js:1:22:
1 │ import * as wasm from './index_bg.wasm';
╵ ~~~~~~~~~~~~~~~~~
1 error
Error: esbuild exited with status exit status: 1
✘ [ERROR] Command failed with exit code 1: cargo install -q worker-build && worker-build --release
```
note that the template had a bunch of warnings so following them this is what I ended up with as `wrangler.toml`:
```toml
name = "..."
workers_dev = true
compatibility_date = "2022-01-20"
main = "build/worker/shim.mjs"
[vars]
WORKERS_RS_VERSION = "0.0.9"
[build]
command = "cargo install -q worker-build && worker-build --release" # required
[[rules]]
globs = ["**/*.wasm"]
type = "CompiledWasm"
```
Contributor guide
Assessment
This issue has not been assessed yet.