You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In recent versions of Node.js (e.g. v17.0.1, but also earlier versions), there is an extra stack frame at async Promise.all (index 0), e.g:
Error: Message.
at file://[redacted]/test-director/test/fixtures/fails.mjs:7:9
at TestDirector.run (file://[redacted]/test-director/index.mjs:121:15)
at file://[redacted]/test-director/test/fixtures/fails.mjs:49:7
at ModuleJob.run (node:internal/modules/esm/module_job:185:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:281:24)
at async loadESM (node:internal/process/esm_loader:88:5)
at async handleMainPromise (node:internal/modules/run_main:65:12)
The StackUtils.clean method fails to remove this extra frame:
This leads to very confusing error stacks when presented to users that don't use Promise.all anywhere in their project.
This also leads to very annoying situations where snapshot tests of cleaned error traces that run in both older and newer Node.js versions fail in whichever environment is not the one the snapshots were saved in.
It's not clear the best way to work around this dilemma until the bug is fixed here in stack-utils, as using regex to remove async Promise.all (index 0) before running StackUtils.clean would have to be careful not to remove Promise.all frames that don't relate to Node.js internals and originate in project code.
The text was updated successfully, but these errors were encountered:
jaydenseric
added a commit
to jaydenseric/test-director
that referenced
this issue
Nov 2, 2021
Oh, or it can be? I can't remember what I do with those frames. I still need to do an audit over what should and should not be considered internal. Maybe you'd like to help?
In recent versions of Node.js (e.g. v17.0.1, but also earlier versions), there is an extra stack frame
at async Promise.all (index 0)
, e.g:The
StackUtils.clean
method fails to remove this extra frame:This leads to very confusing error stacks when presented to users that don't use
Promise.all
anywhere in their project.This also leads to very annoying situations where snapshot tests of cleaned error traces that run in both older and newer Node.js versions fail in whichever environment is not the one the snapshots were saved in.
It's not clear the best way to work around this dilemma until the bug is fixed here in
stack-utils
, as using regex to removeasync Promise.all (index 0)
before runningStackUtils.clean
would have to be careful not to removePromise.all
frames that don't relate to Node.js internals and originate in project code.The text was updated successfully, but these errors were encountered: