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
[JS] ReferenceError: TextDecoder is not defined - running tests with React Testing Library. #11662
Comments
What is your current NodeJS version? https://nodejs.org/api/util.html#class-utiltextdecoder |
Hey @sisco0 ! Thanks for reaching out back to me. I was running version 14, but after research I decided to most recent LTS 16.13.0 in hopes it would resolve the issue, however the error was still present. Here's the environment I am running: System: |
Hello @tielushko , did you have a chance to test the attached Pull Request solution? |
I did test it as well @sisco0, but it seemed to still have the issue. |
I can only confirm the issue. Shouldn't the utf8.ts use Node's
instead of
|
@stopyransky I tried to use the normal package with ES6 imports as well, and it was breaking for me too. I use the es5 packaged one due to the issues the package had in the past with tree-shaking. Either way you import it, the Decoder issue is present. |
It can be similar to this issue jsdom/jsdom#2524 |
The top answer here: seemed to resolve my issues. I also added the TextDecoder from utils and ran the test with the environment specified.
|
Hello!
I am currently trying to use the React Testing library to run my unit/integrated tests, and there's a problem I've been noticing running any component/file that includes apache-arrow imports.
I am currently using the es2015-cjs bundle due to some tree-shaking issues that's been happening with the library, but even when after the solution was introduced and I used es6 import statements, the TextDecoder error was still present.
Here is the output from the terminal:
ReferenceError: TextDecoder is not defined
It appears that the issue is coming from here: https://github.com/apache/arrow/blob/master/js/src/util/utf8.ts
I would appreciate any guidance on this issue!
The text was updated successfully, but these errors were encountered: