-
Notifications
You must be signed in to change notification settings - Fork 1.1k
console.warn Warning: [JSS] Cannot read property 'createElement' of null #993
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
Comments
Thanks for the report. It looks like the code in question is running without a Without a full reproduction it's going to be hard to identify where the issue lies. Please include a cloneable, minimal repository that reproduces the bug. |
When I rerun the tests the same error appears but in different component tests. could it be that this command is causing this issue? |
It seems that the error was a result of putting this chunk of code inside a component instead of outside.
It should be
Moreover, I ended up moving some util tests outside of |
Unfortunately after a few days that the error has been vanished it reappeared again. It is really difficult to make a demo because the app is significantly large, but I will try to share some code from the component that the error is being generated. The problem seems to be generated here when trying to test the opening of a modal:
I tried using also async await inside beforeEach and on each test respectively since opening a modal can be considered an async operation but nothing changes. When I skip the tests inside the describe block the error is gone. |
@kboul I am not familiar with all of the specifics here, but I recently ran into a similar problem and was able to rectify it by changing the following in
Perhaps this is a similar issue to what you're seeing? |
@brekk can you elaborate on why your solution fixes it? I don't understand why the resolution of internal modules would intermittently change to something else, nor how changing moduleDirectories would necessarily fix it. EDIT: I happen to be using rebass in a project and when I add this to the jest config I get these errors: |
I have resolved the error long time ago. Sorry for not providing any details regarding the solution but it can be closed now. |
There's a whole host of issues (all related to jest testing) across various GitHub repos. The root cause of these issues is that jest has started to tear down it's environment while there is still some code running as a consequence of a test case that ends up needing Solution: Make sure your tests are fully complete and you await all timers/timeouts. If your test cases end while code is still being exercised (perhaps in a library you are using) that requires |
I am using
react 17.0.2
along withand I am receiving in the testing console only the following error:

which keeps repeated for many many times.
Could you please advise on where it can be generated or what might have been wrong that creates the error?
It indicates an error source regarding
tiny-warning
which is a library I don't useObject.warning (node_modules/tiny-warning/dist/tiny-warning.cjs.js:13:15)
.The text was updated successfully, but these errors were encountered: