This one would work:
const check = await fcl.send([
sdk.script`pub fun main():Int { return 2 }`
]);
const result = await fcl.decode(check);
This one will throw:
const check = await fcl.send([
sdk.script`pub fun main():Int{ return 2 }`
]);
const result = await fcl.decode(check);
The only difference is the abscence of white space after Int
type. As soon as you add it - it will work as well. Tried to run in Playground - both versions work just fine…
level=warning msg="\x1b[1;31mERR\x1b[0m \x1b[2m[e5b19e]\x1b[0m Execution failed:\nParsing failed:\nunexpected token: got decimal integer, expected ',' or '}'\n:\n unexpected token: got decimal integer, expected ',' or '}'\n"