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

React 16.6.0 bug #32

Closed
dlebedynskyi opened this issue Nov 9, 2018 · 7 comments
Closed

React 16.6.0 bug #32

dlebedynskyi opened this issue Nov 9, 2018 · 7 comments

Comments

@dlebedynskyi
Copy link

There seems to be an issue with react 16.6.0 -1 context api on server side render

getting following errors during render

Warning: Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?
Warning: Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?
Warning: Failed prop type: The prop `context` is marked as required in `Dispatcher`, but its value is `undefined`.
    in Dispatcher

TypeError: Cannot read property 'helmetInstances' of undefined

  • Dispatcher.js:70 Dispatcher.init
    [id-portal-web]/[react-helmet-async]/lib/Dispatcher.js:70:48

  • Dispatcher.js:116 Dispatcher.render
    [id-portal-web]/[react-helmet-async]/lib/Dispatcher.js:116:12

this seems to be happening because  of context consumer is initialized on first run with null values 

return _react2.default.createElement(
_Provider.Context.Consumer,
null,
function (context) {
// 👇 here
return _react2.default.createElement(_Dispatcher2.default, _extends({}, newProps, { context: context }));
}
);


I had similar issues on other Context using packages with server sider render. 
dlebedynskyi added a commit to dlebedynskyi/react-helmet-async that referenced this issue Nov 9, 2018
@dlebedynskyi
Copy link
Author

after additional investigation, I found that problem is actually in react-async-component. Closing PR as not relevant

@mschipperheyn
Copy link

@dlebedynskyi Any suggestions on how you fixed the issue? Running into it myself

@dlebedynskyi
Copy link
Author

dlebedynskyi commented Dec 11, 2018

@mschipperheyn
I just ripped off react-async-component and replaced with https://github.com/smooth-code/loadable-components.

Core issues for me was null passed to provider on SSR. that was a bug in react-async-component.

@mschipperheyn
Copy link

I did the same and I still have the same error :-(

The error is caused I think by react-async-bootstrapper

@mschipperheyn
Copy link

You should reference ctrlplusb/react-async-bootstrapper#14

@aseem2625
Copy link

Similar issue:
I tried integrating with repo and development built is working fine, however, while serving the production built app, throws at server itself.

Warning: Failed prop type: The prop `context` is marked as required in `Dispatcher`, but its value is `undefined`.
    in Dispatcher
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'helmetInstances' of undefined

@kishankanugula
Copy link

@aseem2625 I am also facing the same issue. Did you find any solution? Thank you for any help.

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

No branches or pull requests

4 participants