function ReturnTrueTable()
return true, {a = "b"}
end
.done
call the function:
ReturnTrueTable()
observe the crash:
file:///home/niko/.nvm/versions/node/v20.15.0/lib/node_modules/@permaweb/aos/src/services/errors.js:22
const errorMessage = error.replace(
^
TypeError: error.replace is not a function
at parseError (file:///home/niko/.nvm/versions/node/v20.15.0/lib/node_modules/@permaweb/aos/src/services/errors.js:22:30)
at doEvaluate (file:///home/niko/.nvm/versions/node/v20.15.0/lib/node_modules/@permaweb/aos/src/index.js:533:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Interface.<anonymous> (file:///home/niko/.nvm/versions/node/v20.15.0/lib/node_modules/@permaweb/aos/src/index.js:415:9)
Node.js v20.15.0
Further information:
whenever a function returns two values, ao considers second argument an error message and tries to parse it:
Reproduction:
start a process, with the
.editor
set this code:.done
call the function:
observe the crash:
Further information:
whenever a function returns two values, ao considers second argument an error message and tries to parse it:
the quickest workaround is to return a single value.