maple3142 / maple3142/wasm-jseval

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

Open
#4 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
241
Forks
10
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the suggested duktapeEval demo from the issue in Cloudflare Workers and inspect where the `href` access occurs. Confirm whether the package's runtime detection selects browser behavior, then verify that the demo runs successfully in the Workers environment without the error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, wasm
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.