-
-
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
Uncaught TypeError: Cannot read property 'mountComponent' of undefined error when running create-react-app build version #3335
Comments
Are you exporting (As it works in dev mode, you must have exported it correctly. Still just to make sure.) |
So I'm using subfolders with index.js in each of them to export each component. |
Please provide a minimal complete example reproducing the problem. My guess is that somehow you have wrong versions of some libraries. e.g. mixing React 16 with React DOM 15, or something like this. We can’t help without seeing a runnable example that reproduces this. |
Just reproduced an issue. It's quite similar. Sorry it took quite a bit of time. |
I couldn't reproduce this. The build works fine even with the dev tools open. The firebase link you provided also works with dev tools open. (I am assuming that it doesn't work for you since its a production build). Can you try opening that link from a different machine and check if the issue still exists? |
Any chance you are running a very old version of DevTools? Try removing them and installing again. |
I've re updated my chrome browser on mac, re-installed react dev tools extension offered by Facebook, but the issue still persists. |
Yes, I see the error. If you look at the stack trace it tells exactly where the error is happening: Something called You are using React 16. However the internals they're reading only exist in React 15. This is why it's broken. You can track this problem in opbeat/opbeat-react#10 and opbeat/opbeat-react#19. |
Thank you so much for your help. Sorry I've forgot about replying! Have a good day ! |
StackOverflow link
StackOverflow link
Is this a bug report?
Yes
Can you also reproduce the problem with npm 4.x?
It works on local development mode on both npm, yarn.
Which terms did you search for in User Guide?
Uncaught TypeError: Cannot read property 'mountComponent' of undefined error when running create-react-app build version
Environment
node -v
: v8.4.0npm -v
: v4.6.1yarn --version
(if you use Yarn): 0.20.0npm ls react-scripts
(if you haven’t ejected): v1.0.14Then, specify:
Steps to Reproduce
My create-react-app works fine on development mode, but it is blank page when I run the built one using (npm run build) with this console error.
I didn't change any create-react-app config. One thing I'm suspecting is this part of code and the structure.
Here's App.js
I'm rendering the react app the standard way.
ReactDOM.render(<App />, document.getElementById("root"));
Here's createStore.js
Expected Behavior
Renders like it did on development mode.
Actual Behavior
It's blank page with console error I mentioned.
Reproducible Demo
Just reproduced an issue. It's pretty similar. Sorry it took quite a bit of time.
https://github.com/Seunghunsh/create-react-app-react-dev-tools-issue-minimal-reproduce
(Paste the link to an example project and exact instructions to reproduce the issue.)
The text was updated successfully, but these errors were encountered: