Skip to content

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

Description

@mitya33

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions