Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Errors in AggregateError not displayed properly #14704

Open
loozhengyuan opened this issue Nov 19, 2023 · 7 comments · May be fixed by #15346
Open

[Bug]: Errors in AggregateError not displayed properly #14704

loozhengyuan opened this issue Nov 19, 2023 · 7 comments · May be fixed by #15346

Comments

@loozhengyuan
Copy link

loozhengyuan commented Nov 19, 2023

Version

29.7.0

Steps to reproduce

See https://github.com/loozhengyuan/repro-jest-aggregateerror/actions/runs/6918600341/job/18821023498

Expected behavior

I expected to see each sub error nicely displayed.

Actual behavior

AggregateError:

  at Function.Object.<anonymous>.AxiosError.from (node_modules/axios/lib/core/AxiosError.js:89:14)

Cause:
AggregateError:

Additional context

No response

Environment

System:
  OS: Linux 6.2 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
  CPU: (4) x64 AMD EPYC 7763 64-Core Processor
Binaries:
  Node: 20.9.0 - /opt/hostedtoolcache/node/20.9.0/x64/bin/node
  Yarn: 1.22.21 - /usr/local/bin/yarn
  npm: 10.1.0 - /opt/hostedtoolcache/node/20.9.0/x64/bin/npm
npmPackages:
  jest: ^29.7.0 => 29.7.0
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Jan 19, 2024
@estani
Copy link

estani commented Jan 23, 2024

Indeed this is still happening, and since the original "AggregatedError" is encapsulated in an AxiosError you'll need to handle it as duck-typed:

try {
  // ...
catch (e) {
  let errMsg = e.errors ? e.errors.map((err) => err.toString()).join(', ') : e.toString();
  // ...
}

@github-actions github-actions bot removed the Stale label Jan 23, 2024
@mscharley
Copy link

mscharley commented Feb 6, 2024

This is also happening for raw AggregateErrors as well, that at least should work.

@SimenB SimenB added the Pinned label Feb 6, 2024
@SimenB
Copy link
Member

SimenB commented Feb 6, 2024

PR very much welcome!

@kasir-barati
Copy link

IDK what is going on but I am hitting the same roadblocker and IDK for how long we are gonna have this issue 😞

@imnasnainaec
Copy link

We're seeing a nondescript AggregateError running our Jest tests in a GHA workflow (https://github.com/sillsdev/TheCombine/actions/runs/10601707954/job/29382087602#step:7:47):

FAIL src/components/WordCard/tests/index.test.tsx
  ● WordCard › has summary and full views

    thrown: "Error: AggregateError

      at Object.dispatchError (node_modules/jsdom/lib/jsdom/living/xhr/xhr-utils.js:63:19)
      at Request.<anonymous> (node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js:655:18)
      at ClientRequest.<anonymous> (node_modules/jsdom/lib/jsdom/living/helpers/http-request.js:121:14)
      at processTicksAndRejections (node:internal/process/task_queues:82:21)"
          at Array.map (<anonymous>)

BondarenkoAlex added a commit to BondarenkoAlex/jest that referenced this issue Oct 17, 2024
@BondarenkoAlex BondarenkoAlex linked a pull request Oct 17, 2024 that will close this issue
BondarenkoAlex added a commit to BondarenkoAlex/jest that referenced this issue Oct 17, 2024
BondarenkoAlex added a commit to BondarenkoAlex/jest that referenced this issue Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants