[Bug]: structuredClone is not defined
See original GitHub issueBasic info:
- Node.js version: 18.0.0
- jsdom version: 19.0.0
Minimal reproduction case
Running a jest test that calls the structuredClone global using the jsdom environment
structuredClone();
I first opened this issue in the jest repo and was instructed to open it here.
Issue Analytics
- State:
- Created a year ago
- Reactions:36
- Comments:12 (1 by maintainers)
Top Results From Across the Web
`structuredClone` is not defined · Issue #12628 · facebook/jest
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue...
Read more >"ReferenceError: structuredClone is not defined" using jest ...
I'm running tests with jest in a simple NodeJS app that uses typescript. My test is throwing an error: ReferenceError: structuredClone is not ......
Read more >structuredClone() - Web APIs - MDN Web Docs
The global structuredClone() method creates a deep clone of a given value using the structured clone algorithm.
Read more >structuredClone is not a function - LWC
However, when I attempt to use this in an LWC, I get the following error: [structuredClone is not a function].
Read more >Deep-copying in JavaScript using structuredClone - web.dev
Non -primitive values are handled as references, meaning that the act of copying the value is really just copying a reference to the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
As an alternative, you could mock structuredClone in your test file:
I can vouch that this is still an issue using
jest-environment-jsdomv28.1.3