Description
Describe the Bug
I have noticed that when the compilation target is web
that the maybe_parameter
of the initi(input, maybe_memory)
is required. The name implies that it might be missing and especially for the first call to init
it's most likely missing if input
is a string and the module is fetched. Only subsequent calls might have memory. Maybe we change the type of this to also accept null
or undefined
or mark it as optional.
I think it would make sense to have a sanity check in load
that, if module
is not a function nor a Response
object, meaning it's a WebAssembly module, then we add a check to ensure that maybe_memory
is not undefined
.
Alternatively, we can pass null!
for memory_memory
but to me this feels hacky.
Steps to Reproduce
- Compile Rust to
wasm32-unknown-unknown
with target beingweb
If there is a solution to this and a clear path, I am volunteering to work on a PR to get this resolved.