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?