This repository has been archived by the owner on Apr 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 786
SSR fails with NODE_ENV=production #237
Comments
rewop
changed the title
SSR fails in with NODE_ENV=production
SSR fails with NODE_ENV=production
Sep 28, 2016
I'm also seeing something similar, my code is similar to above but without the router match wrapper. |
I have created a PR to show how the problem would be fixed in my case. I would like feedback on this one from @jbaxleyiii as he worked on #205 |
Merged
I assume this is fixed in 0.6.0 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I am doing SSR with [email protected] and node v6.5.0 and.
NODE_ENV=development
server side works correctly.NODE_ENV=production
, SSR fails with the following error:The error can be decoded at http://facebook.github.io/react/docs/error-decoder.html?invariant=23, and is referred to the fact that the prop children of ApolloProvider is undefined.
How to reproduce
This is my code, a bit simplified:
Root.js
server.js (snippet)
Just run the server with
NODE_ENV=production node server.js
Debug
In my scenario only in production ApolloProvider is being rendered with the property given to the Root component, which makes the application crash.
I reduced the problem to this piece of code.
I added
console.log(e)
in the empty catch block, and I noticed to following:caught error TypeError: Can't add property props, object is not extensible
If I remove the block my application works again.
So apparently in production Component.props is set to the property of the parent component. This is not correct, because Component is given to the next iteration, but it has the wrong props and context.
So I wonder, why the try catch blog to overwrite Component if it is frozen?
The bug is introduced in version 0.5.5 by #205.
Workaround
Use [email protected] instead
Version
The text was updated successfully, but these errors were encountered: