Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Argument 1 ('event') to EventTarget.dispatchEvent must be an instance of Event #11005

Open
anudit opened this issue May 11, 2024 · 0 comments
Open
Labels
bug Something isn't working typescript Something for TypeScript

Comments

@anudit
Copy link

anudit commented May 11, 2024

What version of Bun is running?

1.1.8+89d25807f

What platform is your computer?

Darwin 23.4.0 arm64 arm

What steps can reproduce the bug?

Minimal Reproduction,

// bun index.ts
import { buildBn128, F1Field } from "ffjavascript";

async function main() {
    let bn128 = await buildBn128();
    const F = new F1Field(bn128.r);

    const a = F.e("9");
    const b = F.sqrt(a);
    console.log(b)

    bn128.terminate();
}

main()

Errors with

170 |     event.data = data;
171 |     if (q == null) self.dispatchEvent(event);else q.push(event);
172 |   });
173 |   threads.parentPort.on('error', err => {
174 |     err.type = 'Error';
175 |     self.dispatchEvent(err);
          ^
TypeError: Argument 1 ('event') to EventTarget.dispatchEvent must be an instance of Event
      at /Users/anudit/Documents/GitHub/semaphore-minimal/node_modules/web-worker/cjs/node.js:175:5
[1]    75686 trace trap  bun index.ts

What is the expected behavior?

Expected output when I run with pnpx tsx index.ts is 3n

What do you see instead?

No response

Additional information

No response

@anudit anudit added bug Something isn't working typescript Something for TypeScript labels May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working typescript Something for TypeScript
Projects
None yet
Development

No branches or pull requests

1 participant