sidorares / sidorares/node-mysql2

Bun Error.prepareStackTrace throw's error "Caused by: First argument must be an Error object failed"

Open Beginner friendly
#4,480 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bun needs reproduction
Dominant language
TypeScript
Stars
4.4k
Forks
680
Avg merge
9h 7m
Merged PRs (30d)
59

Description

Bun Error.prepareStackTrace throw's error "Caused by: First argument must be an Error object failed"
the fix is to use Error object instead of plain {}?
https://github.com/sidorares/node-mysql2/blob/8b1f829d3706404ab372cf97bd77ebcf86578d97/lib/promise/capture_local_err.js#L4

Contributor guide

Open the contributing guide

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 with lib/promise/capture_local_err.js at the linked line and inspect how the error is created before Error.prepareStackTrace runs under Bun. Reproduce the reported failure with Bun and verify that the resulting error handling no longer reports that the first argument is not an Error object.

Written by the indexing model from the issue text.

Assessment

Tech stack
bun, node.js, typescript
Domain
backend, databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.