Open chrisdickinson opened 11 months ago
Noting to anyone who finds this issue from an error message like:
SyntaxError: Cannot convert [object Promise] to a BigInt
async functions (or functions that explicitly return a promise) are only supported if runInWorker: true
is passed to the plugin on initialization: https://github.com/extism/js-sdk/blob/main/examples/node.js#L15
Since async host functions are only supported by plugins running on background threads, we should throw an early error if any host functions are
instanceof AsyncFunction
. Additionally, we should catch any "could not convert Promise to BigInt"-style errors that are emitted during runtime and wrap them with some help text.