hapijs / hapijs/boom

Missing .stack value on node 21

Open
#302 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
2.9k
Forks
191
PR merge metrics
No merged PRs in 30d

Description

#### Support plan

* *is this issue currently blocking your project?* (yes/no): no
* *is this issue affecting a production system?* (yes/no): no

#### Context

* *node version*: v21.1.0
* *module version with issue*: 10.0.1
* *last module version without issue*:
* *environment* (e.g. node, browser, native): node
* *used with* (e.g. hapi application, another framework, standalone, ...): standalone
* *any other relevant information*:

This issue is caused by a [V8 engine upgrade](https://github.com/v8/v8/commit/79cdd69a1cfa9d3b4d9b6dec7203db4dabe618b4) that changes the behaviour of `Hoek.clone()`. A fix is proposed in: https://github.com/hapijs/hoek/pull/390

#### What are you trying to achieve or the steps to reproduce?

```js
const error = new Error("fail");
const boom = Boom.badImplementation(error);

assert.equal(boom.stack, error.stack);
```

#### What was the result you got?

```
Uncaught AssertionError [ERR_ASSERTION]: undefined == 'Error: fail\n' +
' at REPL2:1:15\n' +
' at ContextifyScript.runInThisContext (node:vm:121:12)\n' +
' at REPLServer.defaultEval (node:repl:599:22)\n' +
' at bound (node:domain:432:15)\n' +
' at REPLServer.runBound [as eval] (node:domain:443:12)\n' +
' at REPLServer.onLine (node:repl:929:10)\n' +
' at REPLServer.emit (node:events:527:35)\n' +
' at REPLServer.emit (node:domain:488:12)\n' +
' at [_onLine] [as _onLine] (node:internal/readline/interface:416:12)\n' ...
at REPL5:1:8
at ContextifyScript.runInThisContext (node:vm:121:12)
at REPLServer.defaultEval (node:repl:599:22)
at bound (node:domain:432:15)
at REPLServer.runBound [as eval] (node:domain:443:12)
at REPLServer.onLine (node:repl:929:10)
at REPLServer.emit (node:events:527:35)
at REPLServer.emit (node:domain:488:12)
at [_onLine] [as _onLine] (node:internal/readline/interface:416:12)
at [_line] [as _line] (node:internal/readline/interface:887:18) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: undefined,
expected: 'Error: fail\n' +
' at REPL2:1:15\n' +
' at ContextifyScript.runInThisContext (node:vm:121:12)\n' +
' at REPLServer.defaultEval (node:repl:599:22)\n' +
' at bound (node:domain:432:15)\n' +
' at REPLServer.runBound [as eval] (node:domain:443:12)\n' +
' at REPLServer.onLine (node:repl:929:10)\n' +
' at REPLServer.emit (node:events:527:35)\n' +
' at REPLServer.emit (node:domain:488:12)\n' +
' at [_onLine] [as _onLine] (node:internal/readline/interface:416:12)\n' +
'...',
operator: '=='
```

#### What result did you expect?

No assertion error, as on node v20.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.