-
Notifications
You must be signed in to change notification settings - Fork 252
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
ReferenceError: EventTarget is not defined in node<16 #817
Comments
We won't include a polyfill for now as it is unclear if there are any users out there who use environments without |
Just ran into this today. Running Node 14.18. |
@make-github-pseudonymous-again Which DOM implementation are you using? Did you manage to set |
I have not setup a particular DOM implementation. This is my first try at |
|
OK. I may have had too much enthusiasm when the first render-only tests passed. I probably need to do what is explained here for the interactive tests to work. Thanks for taking the time to lead me on the path of solution. |
Mmh. I am running into another problem trying to import
Do you have another DOM implementation to recommend to see if it produces the same error? PS: Mmh maybe that warning has nothing to do with the error. Either way, I cannot make 'global-jsdom' work at the moment. |
I managed to make it work using I found something that works for now... PS: OK I figured it out. Meteor runs tests both for the server and for the client. The server environment has no |
@testing-library/user-event
version: 14.0.0-beta.3Relevant code or config
Problem description:
EventTarget
does not exist in older node versions.Importing
user-event
results in aReferenceError
because:user-event/src/utils/dataTransfer/Clipboard.ts
Line 34 in 2c5d9f1
Suggested solution:
Either
user-event
requires a DOM implementation which requiresEventTarget
so any DOM implementation should already ship with a polyfill. We might as well just ask our users to setEventTarget
globally if they use a DOM implementation that does not already do so in an older node environment.The text was updated successfully, but these errors were encountered: