Skip to content

Could not resolve "./index_bg.wasm" #41

@mimoo

Description

@mimoo

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:

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions