evanw / evanw/node-source-map-support

feature request: do not truncate the 'cause' value on errors

Open
#337 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.2k
Forks
223
PR merge metrics
No merged PRs in 30d

Description

It truncates the error cause lines

```js
// app.js
require('source-map-support').install();
throw new Error('test 123', { cause: new Error('foo') })
```

### current behavior

![image](https://github.com/evanw/node-source-map-support/assets/13461315/94121e28-7c42-459f-b63e-821004ba7bdb)

### expected behavior

![image](https://github.com/evanw/node-source-map-support/assets/13461315/bb3ffd85-48b5-4c7a-a072-a5e500a3cf09)

note that it's truncating the last lines

#### version

- package: `0.5.21`
- nodejs: 22

---

that's because the line bellow won't display the cause as it doesn't belongs to the stack trace:

https://github.com/evanw/node-source-map-support/blob/7b5b81eb14c9ee6c6537398262bf7dab8580621c/source-map-support.js#L499

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.