wasm-jseval icon indicating copy to clipboard operation
wasm-jseval copied to clipboard

Use in CloudFlare Workers - error with "cannot read from undefiend (trying to read 'href')

Open mitya33 opened this issue 2 years ago • 0 comments

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?

mitya33 avatar Jan 17 '24 15:01 mitya33