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?
@PattanAhmed Yeah, there was in fact a BigInt error, but that would only occur if the function was called, which I couldn't get to happen. It seems like that means it was properly ran for you, what browser are you using?