Once I call my function called "main," from /script.js, I get an error, why?
The code seems perfectly valid, in every single way.
Sorry that my previous answer did not address the issue, I clearly misinterpreted the question.
However, perhaps this can be of some help. According to this github issue, it appears that importing an i64 from wasm into JS isn't possible. It's a little old, but it might still be relevant since as far as I know JS doesn't have native support for int64's yet.
Perhaps try changing the
i32's, and see if the issue goes away?
It clearly says:-
Check this example and let this example fit in a place something that fits in your code somewhere where
BigInt is converted to a
const myBigInt = BigInt(10); // of course, `10n` also works const myNumber = Number(myBigInt);
Hope this helps