React Component is not rendering after deploying to Netlify

React Component is not rendering after deploying to Netlify. It works on local machine. component not rendering at all. When I check in React dev tool, I see the state that jokes are updated but nothing in UI.

Thanks in advance.

Site name: https://dadjokestest.netlify.app/

build logs:
deploying to main site URL…
:heavy_check_mark: Finished hashing 18 files
:heavy_check_mark: CDN requesting 0 files
:heavy_check_mark: Finished uploading 0 assets
:heavy_check_mark: Deploy is live!

Logs: https://app.netlify.com/sites/dadjokestest/deploys/5f63b35bd3538f30a4d95060
Unique Deploy URL: https://5f63b35bd3538f30a4d95060--dadjokestest.netlify.app
Website URL: https://dadjokestest.netlify.app

hi there,

is it possible that you’re missing some content from your upload? did you add it to git?

12:04:59 PM: Creating deploy upload records
12:05:01 PM: Starting post processing
12:05:01 PM: Post processing - HTML
12:05:01 PM: Post processing - header rules
12:05:01 PM: Post processing - redirect rules
12:05:01 PM: Post processing done
12:05:02 PM: Site is live

according to your deploy log, we deployed your whole site in 3 seconds. netlify is FAST, but not that fast! I am wondering if something got left out.

Also, This Support Guide contains a ton of useful debugging tips that can likely help you solve your problem :slight_smile:

this might also be relevant:

First I deployed from GitHub but that did not work (same issue), then I installed netlify-cli and deployed from the computer.
These are the steps:
npm run build
npm install netlify-cli -g
netlify deploy
./build
netlify deploy --prod

ok, so in your latest deploy, do things work as intended? If not, does your LOCAL copy work as intended? If not, that’s where you should start debugging :slight_smile: If so, it’s quite a mystery that deploying that local copy doesn’t work as well as your local, unless your site requires a server to do some computation at browse time? If that is the case - please check out our hosting philosophy here:

If not, please let us know how you run locally and what the exact difference is - “react component is not rendering” isn’t quite helpful in understanding the error - perhaps instead “I see this locally (screenshot) and on netlify this at the same URL (screenshot). In the browser dev tools I see more warnings on Netlify, and I’ve quoted those errors that I don’t get when running locally…”

There are no warnings on either side (locally or Netlify). And if you open the React devtools on Netlify site you can see the state of jokes but it won’t render on browser but it works fine locally.

Screen shot from local computer: Image from Gyazo

And from Netlify: I have to post it again because new users can only embed ones.

Netlify site:
Image from Gyazo


mine too , I have same issue like yours, have you fix this issue ?
if not , I hope someone can help us, cause it works fine in local, when it deploys doesn’t show anything

Hey @eralpkor,
What version of node are you using locally? You may need to set the environment variable on the Netlify side to be the same:

I say that because this seems to be a popular project, and at least some folks have been able to successfully deploy it on Netlify:

Hey @rbayuokt,
Similar to @eralpkor, could you please check which version of Node you’re building with locally and make sure you’re building with the same version on Netlify using the docs I linked above? If that doesn’t help, it’d be great if you could share your Netlify url and repo if it’s public- thank you!

Local Node version is 12.18.2 LTS

Hey @eralpkor,
You can try setting the NODE_ENV variable to that number as described here since you’re building on Netlify with a slightly different version:

But this is more likely an issue with your connection to Heroku:

If you try to enter a name in the search bar, you’ll see failed requests in the “Network” tab of your browser dev tools.

I’m also having this issue where my React components are displaying locally but not on the netlify’d version. I’m using node v12.9.0 and have updated the Node Environment for the site to: NODE_ENV — 12.9.0 , but no luck. Thanks for any help you can provide!

netlify url: https://wonderful-joliot-d08f99.netlify.app/
repo: https://github.com/codecaviette/react-shopping-cart

Hi @codecaviette, welcome to the community!

I checked your site but did not see that you have the NODE_ENV env var set herehttps://app.netlify.com/sites/wonderful-joliot-d08f99/settings/deploys#environment. Can you try setting it and see if that helps?

1 Like

Hi @Dennis, thanks for the reply! I double-checked the NODE_ENV env var is now set, but unfortunately that did not help – the deployed page is still blank! Any other suggestions?

This is also happening on my other deployed page here: https://jmc-grocery-list.netlify.app/ – repo: https://github.com/codecaviette/grocery-list

Hey there, thanks for reaching out.

What you are describing sounds a bit like a an issue with case sensitivity on our system.

Can you give this a read through and let us know if that fixes the issue?

Hi @perry , Thanks for replying. I’m not getting any error messages about missing files in either of my projects when building on Netlify, so unfortunately, this didn’t help in my case.

What else would you suggest trying?

hi there, sorry to be slow to respond. Is this still a problem, or were you able to make any progress?