emscripten-core / emscripten-core/emscripten

TypeError: WebAssembly.instantiate(): Import #87 module="GOT.func" error: module is not an object or function

Open
#17,787 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

Any idea on this issue?
code
``` javascript
async function loadAvutil(imports) {
const fetchPromise = fetch('./ffmpeg/lib/libavutil.wasm');
// const { module, instance } = await WebAssembly.instantiateStreaming(fetchPromise);
// To create a new instance later:
// const otherInstance = await WebAssembly.instantiate(module);

imports = imports || {};
imports.env = imports.env || {};
imports.env.memoryBase = imports.env.memoryBase || 0;
imports.env.tableBase = imports.env.tableBase || 0;
if (!imports.env.memory) {
imports.env.memory = new WebAssembly.Memory({ initial: 256 });
}
if (!imports.env.table) {
imports.env.table = new WebAssembly.Table({ initial: 0, element: 'anyfunc' });
}

const { instance } = await WebAssembly.instantiateStreaming(fetchPromise, imports);

//const result = instance.exports.FetchffmpegWrapper();
//console.log(result);
};
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.