You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
trying to make a clearer explanation of my problem, when you do:
import { greet } from "./hello_world_bg.wasm"
with webpack 4, the signature should be: greet(a: number, b: number): void ? (not verified)
with webpack 5, the signature is greet(string): void. (verified)
So, the hello_world_bg.d.ts which is currently generated is incorrect. For me, it should be: hello_world_bg.d.ts export function greet(name: string): void;
instead of (current implementation): hello_world_bg.d.ts
export const memory: WebAssembly.Memory;
export function greet(a: number, b: number): void;
export function __wbindgen_malloc(a: number): number;
export function __wbindgen_realloc(a: number, b: number, c: number): number;
@Pauan The problem has been fixed with the new wasm-bindgen version (0.2.61).
I tested it only with hello_world example. I will test the new version with more complex examples.thx
for version <=0.2.60, it was necessary to import from wasm file to have access to the helper functions.
Describe the Bug
The .d.ts are invalid with webpack 5 wasm module import. The interface exposed from the wasm import is the one from the helper.js
If i take the hello_world example from wasm_bindgen guide. hello_world_bg.d.ts generated is:
and it should be this
export function greet(name: string): void;
I think
Expected behavior:
The module declaration should be modify to support webpack 5 new import when stable
Thx
The text was updated successfully, but these errors were encountered: