wasm-jseval
wasm-jseval copied to clipboard
Use in CloudFlare Workers - error with "cannot read from undefiend (trying to read 'href')
This error suggests the package believes it's running in the browser when in fact it's running in Node (in my case, within CF Workers.)
This is when running the suggested demo code:
const { duktapeEval, quickjsEval } = require('wasm-jseval')
duktapeEval.getInstance().then(mod => {
console.log(mod.eval('1+1')) // 2
const add = mod.newFunction(['a', 'b'], 'return a+b')
console.log(add(1, 2)) // 3
})
Any thoughts here?