Skip to content

--target web causes Error: not implemented... yet...Β #1523

@michalmoc

Description

@michalmoc

πŸ› Bug description

I've got a typescript module written on top of wasm bindings from rust. With wasm-pack build --target bundler I can run tests and everything works correctly. But if I change target to web and add await init(); on top of my module I get errors

 FAIL  test/types.test.ts [ test/types.test.ts ]
TypeError: fetch failed
 ❯ __wbg_init pkg/cooklang_wasm.js:577:51
    575|     __wbg_init_memory(imports);
    576| 
    577|     const { instance, module } = await __wbg_load(await module_or_path, imports);
       |                                                   ^
    578| 
    579|     return __wbg_finalize_init(instance, module);
 ❯ index.ts:24:1
 ❯ test/types.test.ts:2:1

Caused by: Error: not implemented... yet...
 ❯ __wbg_init pkg/cooklang_wasm.js:572:26
 ❯ index.ts:24:7

πŸ€” Expected Behavior

My tests pass.

πŸ‘Ÿ Steps to reproduce

Use --target web, add import init from "pkg/some_package.js"; await init(); and run vitest importing the module.

🌍 Your environment

wasm-pack version: 0.13.1
rustc version: 1.88.0

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