-
-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Jest test pass but I always get a “Nothing was returned from render” error when running jest coverage #9322
Comments
I think this might be the same issue as #8689. Seems like a bug in 3.4.1, current solution is to downgrade react-scripts to 3.4.0. |
Hi @kentcdodds I find some solution to resole this issue in this issue #8689 , Or do you have any good suggestion to resolve this issue? Thanks. |
You may not like this workaround, but you could just not run with coverage enabled until this is fixed:
|
the create-react-app cli dont install the react-scripts dependency to my app, I dont find this react-scripts dependency in package.json
|
Anyone know how to resolve this issus? |
After I ran |
I'm having the same issue when running with --coverage --watchAll. Funny thing is that when I do not run with coverage enabled, it runs smoothly. |
@kentcdodds |
PRs are welcome. I don't know which comments it could be. I doubt it is related to Testing Library's comments. I'd suggest anyone with this issue try the alpha version of react-scripts and see if the issue still exists. I have a feeling it'll be fixed. |
I was able to get it working by rolling back from |
I updated my CRA project with |
having created a fresh CRA today, and coming across this issue, I downgraded from 3.4.3 to 3.4.0 |
I am experiencing the same problem in a fresh CRA (with Typescript). Downgrading to 3.4.0 worked for me. |
I have found that renaming In the base CRA app, this would mean |
The same issue happens with react-scripts@4.0.0 |
Downgrade React Scripts to 3.4.0 due to facebook/create-react-app#9322
Downgrade React Scripts to 3.4.0 due to facebook/create-react-app#9322
Downgrade React Scripts to 3.4.0 due to facebook/create-react-app#9322
@chrkaatz Same issue here. Any gotchas? |
Nothing yet and watching the comments here... |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
Don't close this issue. This is an automatic message by Fresh - a bot against stale bots. |
This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue. |
That's an aggressive stale bot, very disappointing. |
able to run coverage check as far as I can see
|
Note: I used create-react-app to create a new App, but I got an error I cant fix, I already looked through similar questions; the solutions provided do not solve my problem.
I am getting the following error in my React app:
console.error node_modules/jsdom/lib/jsdom/virtual-console.js:29 <br> Error: Uncaught [Error: Test(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.]
My Jest plug dependencies:
I try to search reason on google and get taht maybe this issue caused by babel version, solution looks like below
{ "presets": [ [""@babel/preset-react"", { "pragma": "React.createElement" }] ] }
but we use babel-preset-react-app, so could you help advise how to resolve this issue?
The text was updated successfully, but these errors were encountered: