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

Uncaught ReferenceError: React is not defined #319

Closed
sebastiaanviaene opened this issue May 5, 2017 · 6 comments
Closed

Uncaught ReferenceError: React is not defined #319

sebastiaanviaene opened this issue May 5, 2017 · 6 comments
Labels

Comments

@sebastiaanviaene
Copy link

When I deploy my electrode app on docker (locally) it builds but when I start it up it says :
Uncaught ReferenceError: React is not defined

My css from the bundle is loaded as I can see it but some components don't work.
Can anybody help me with this problem ? I have succesfully deployed and run a docker image from this project before. I don't know what has changed.

@animesh10
Copy link
Contributor

animesh10 commented May 5, 2017

We recently upgraded our Docker Image.
Try referring to the Dockerfile for our Universal-react-node sample app.
Is this error happening while starting the server ? Make sure you have a successful gulp build. The server side rendering mechanism references react files which need to have been transpiled first.

@sebastiaanviaene
Copy link
Author

This error is happening when opening the project in the browser, starting the server works fine.
I have recently ( a week ago ) succesfully ran a docker image of my Electrode project but after some work on it i've got this problem. The gulp build has no errors as it is one of my docker build steps and the build works fine.

@sebastiaanviaene
Copy link
Author

Is it best to just pull this electrode image and then replace the server + client folders with the ones in my project ?

@animesh10
Copy link
Contributor

You can try that, but I can't comment if it will work as is. Does it work in your local following the same commands that you have in the Dockerfile ?

@vklein
Copy link

vklein commented Aug 22, 2017

Is there any solution because i am getting the same error when using electrode in prod env.
maybe this is not working correct?

info: Overriding module react with copy optimized for production

info: Overriding module react-dom with copy optimized for production

This also happens in docker as well as when i am doing same steps as in dockerfile on my local maschine. Both time i am getting Uncaught ReferenceError: React is not defined in my browser console.

@jchip
Copy link
Member

jchip commented Aug 22, 2017

That message is concerning server side rendering only. When you see error in browser console, that's client side.

Would you be able to provide sample code that repro this issue?

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

No branches or pull requests

4 participants