jsdom: ReferenceError: AggregateError is not defined
Basic info:
- Node.js version: 14.15.5
- jsdom version: 16.6.0
Minimal reproduction case
I recently upgraded jest-environment-jsdom from 26.6.2 to 27.0.3 and I’m now seeing some issues that I believe are related to this package. If I run multiple test files at once, everything is fine, but if I run a single test file, then there’s a crash in this package:
● Test suite failed to run
evalmachine.<anonymous>:1
AggregateError
^
ReferenceError: AggregateError is not defined
at evalmachine.<anonymous>:1:1
at setupWindow (node_modules/jsdom/lib/jsdom/browser/Window.js:111:55)
at new Window (node_modules/jsdom/lib/jsdom/browser/Window.js:223:3)
at exports.createWindow (node_modules/jsdom/lib/jsdom/browser/Window.js:95:10)
at new JSDOM (node_modules/jsdom/lib/api.js:36:20)
I’m not sure what’s going wrong here. I’ve never seen this error before and I can’t find any trace of it on the Internet, but after upgrading, everyone on my team is seeing this problem.
I had initially filed this issue here (https://github.com/simon360/jest-environment-jsdom-global/issues/47), but even after purging jest-environment-jsdom-global from the repo, I’m still hitting this crash.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 4
- Comments: 15 (5 by maintainers)
Any update on this thread? I am facing the same issue.
I am just seeing this error:
Nothing more is displayed.
Honestly, this library could be to blame! We just have no way of knowing without you providing us with a minimal reproducible example that does not involve other libraries. We don’t have the time to debug all the interactions with various things people layer on top of jsdom so it’s just not something we’re interested in.
According to MDN, AggregateError only works in Node 15+:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError
Is there an implicit assumption that all users of jsdom must be on Node 15+? That would be a shock to me, since 14 is the current LTS version.