Skip to content
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: document is not defined var actContainerElement = document.createElement('div'); #14772

Closed
joepuzzo opened this issue Feb 6, 2019 · 3 comments

Comments

@joepuzzo
Copy link

joepuzzo commented Feb 6, 2019

React V 16.8

Im using jsdom and enzyme to unit test my lib. When i updated to V16.8 this morning I started getting the following. I think it has to do with the fact that test utils is a js IIFE, and the jsdom document object has not been created yet.

/Users/n0280500/Documents/Dev/ReactTools/informed/node_modules/react-dom/cjs/react-dom-test-utils.development.js:944
var actContainerElement = document.createElement('div');

ReferenceError: document is not defined

For more context: I have a setup file that gets executed before any of my enzyme tests as described by the docs https://airbnb.io/enzyme/docs/guides/jsdom.html

@koba04
Copy link
Contributor

koba04 commented Feb 6, 2019

I think this will be fixed by #14768

@threepointone
Copy link
Contributor

That's right, this is a dupe of #14764. Closing this one. Sorry for the trouble!

@bvaughn
Copy link
Contributor

bvaughn commented Feb 6, 2019

Should be fixed by the latest 16.8.1 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants
@threepointone @bvaughn @koba04 @joepuzzo and others