Patch bug in stack-utils
npm package
#6451
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Lockdown breaks Ava under certain versions of NodeJS. It turns out to be due to a bug in the
stack-utils
npm package which trips over the override mistake. I've filed an issue with the maintainer of that package, but in the meantime this patch deals with the problem.It is unclear which version of Node starts manifesting the problem, but at least v16.16.0 has it. The problem manifests as Ava test failures being reported unhelpfully -- whereas one should get a stack backtrace from the point in the test file where the failure happened, usually along with a nice diff between expected and actual result values from things like
t.deepEqual
, instead you get an "Unable to serialize error" exception with a stack trace from somewhere deep in the bowels of Ava. The problem was thestack-utils
npm package (which Ava uses) failing a property assignment toObject.prototype
(which should have been a simple property assignment to an ordinary property of an ordinary object but wasn't because of the override mistake) in an environment whereObject.prototype
is frozen because of lockdown.Without this patch (or, the eventual hoped for fix to the
stack-utils
npm package itself), debugging Ava test failures is grossly inhibited if you are using one of the newer versions of Node that manifest the problem.See tapjs/stack-utils#70