testing-library / dom-testing-library

🐙 Simple and complete DOM testing utilities that encourage good testing practices.
https://testing-library.com/dom
MIT License
3.25k stars 463 forks source link

TextEncoder is not defined #1245

Closed nikgun1984 closed 1 year ago

nikgun1984 commented 1 year ago

After upgrading to jest29.5 from jest27, i am getting the following error: "ReferenceError: TextEncoder is not defined". I imported TextEncoder from utils but it still shows the same error. > 10 | import { JSDOM } from 'jsdom'

MatanBobi commented 1 year ago

This looks like an issue in jest and not something we have a way to fix. There are some workarounds already available so I'm closing this one. Thanks.

luchillo17 commented 10 months ago

This is not an issue in jest, it's in jsdom, been like that for years and we can only work around it until it's fixed. https://github.com/jsdom/jsdom/issues/2524