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

Server-side rendering is broken - document not defined #2048

Closed
Webkadabra opened this issue Nov 3, 2015 · 6 comments
Closed

Server-side rendering is broken - document not defined #2048

Webkadabra opened this issue Nov 3, 2015 · 6 comments
Labels
docs Improvements or additions to the documentation duplicate This issue or pull request already exists

Comments

@Webkadabra
Copy link

Just updated to 0.13.1, now I have this error:

500 ReferenceError: document is not defined
   at [object Object].componentWillMount (D:\WebServers\custom_home\bfk-new-este\node_modules\material-ui\lib\overlay.js:64:34)
   at [object Object].ReactCompositeComponentMixin.mountComponent (D:\WebServers\custom_home\bfk-new-este\node_modules\react\lib\ReactCompositeComponent.js:210:12)
   at [object Object].wrapper [as mountComponent] (D:\WebServers\custom_home\bfk-new-este\node_modules\react\lib\ReactPerf.js:66:21)
   at Object.ReactReconciler.mountComponent (D:\WebServers\custom_home\bfk-new-este\node_modules\react\lib\ReactReconciler.js:37:35)
   at ReactDOMComponent.ReactMultiChild.Mixin.mountChildren (D:\WebServers\custom_home\bfk-new-este\node_modules\react\lib\ReactMultiChild.js:241:44)
   at ReactDOMComponent.Mixin._createContentMarkup (D:\WebServers\custom_home\bfk-new-este\node_modules\react\lib\ReactDOMComponent.js:588:32)
   at ReactDOMComponent.Mixin.mountComponent (D:\WebServers\custom_home\bfk-new-este\node_modules\react\lib\ReactDOMComponent.js:478:29)
   at Object.ReactReconciler.mountComponent (D:\WebServers\custom_home\bfk-new-este\node_modules\react\lib\ReactReconciler.js:37:35)
   at [object Object].ReactCompositeComponentMixin.mountComponent (D:\WebServers\custom_home\bfk-new-este\node_modules\react\lib\ReactCompositeComponent.js:225:34)
   at [object Object].wrapper [as mountComponent] (D:\WebServers\custom_home\bfk-new-este\node_modules\react\lib\ReactPerf.js:66:21)
   at Object.ReactReconciler.mountComponent (D:\WebServers\custom_home\bfk-new-este\node_modules\react\lib\ReactReconciler.js:37:35)
   at [object Object].ReactCompositeComponentMixin.mountComponent (D:\WebServers\custom_home\bfk-new-este\node_modules\react\lib\ReactCompositeComponent.js:225:34)
   at [object Object].wrapper [as mountComponent] (D:\WebServers\custom_home\bfk-new-este\node_modules\react\lib\ReactPerf.js:66:21)
   at Object.ReactReconciler.mountComponent (D:\WebServers\custom_home\bfk-new-este\node_modules\react\lib\ReactReconciler.js:37:35)
   at ReactDOMComponent.ReactMultiChild.Mixin.mountChildren (D:\WebServers\custom_home\bfk-new-este\node_modules\react\lib\ReactMultiChild.js:241:44)
   at ReactDOMComponent.Mixin._createContentMarkup (D:\WebServers\custom_home\bfk-new-este\node_modules\react\lib\ReactDOMComponent.js:588:32)
From previous event:
   at D:/WebServers/custom_home/bfk-new-este/src/server/frontend/render.js:77:8
   at D:\WebServers\custom_home\bfk-new-este\node_modules\react-router\lib\match.js:58:5
   at D:\WebServers\custom_home\bfk-new-este\node_modules\react-router\lib\useRoutes.js:120:15
   at done (D:\WebServers\custom_home\bfk-new-este\node_modules\react-router\lib\AsyncUtils.js:49:19)
   at D:\WebServers\custom_home\bfk-new-este\node_modules\react-router\lib\AsyncUtils.js:55:7
   at getComponentsForRoute (D:\WebServers\custom_home\bfk-new-este\node_modules\react-router\lib\getComponents.js:9:5)
   at D:\WebServers\custom_home\bfk-new-este\node_modules\react-router\lib\getComponents.js:28:5
   at D:\WebServers\custom_home\bfk-new-este\node_modules\react-router\lib\AsyncUtils.js:54:5
   at Array.forEach (native)
   at Object.mapAsync (D:\WebServers\custom_home\bfk-new-este\node_modules\react-router\lib\AsyncUtils.js:53:9)
   at Object.getComponents [as default] (D:\WebServers\custom_home\bfk-new-este\node_modules\react-router\lib\getComponents.js:27:15)
   at D:\WebServers\custom_home\bfk-new-este\node_modules\react-router\lib\useRoutes.js:114:37
   at Object.runEnterHooks (D:\WebServers\custom_home\bfk-new-este\node_modules\react-router\lib\TransitionUtils.js:44:5)
   at finishMatch (D:\WebServers\custom_home\bfk-new-este\node_modules\react-router\lib\useRoutes.js:107:24)
   at D:\WebServers\custom_home\bfk-new-este\node_modules\react-router\lib\useRoutes.js:91:13
   at done (D:\WebServers\custom_home\bfk-new-este\node_modules\react-router\lib\AsyncUtils.js:13:14)
   at D:\WebServers\custom_home\bfk-new-este\node_modules\react-router\lib\matchRoutes.js:131:9
   at D:\WebServers\custom_home\bfk-new-este\node_modules\react-router\lib\matchRoutes.js:100:13
   at done (D:\WebServers\custom_home\bfk-new-este\node_modules\react-router\lib\AsyncUtils.js:13:14)
@oliviertassinari
Copy link
Member

@Webkadabra Duplicate of #2013. Can you pull the latest master? It should fix your issue, if not feel free to reopen this issue.

@Webkadabra
Copy link
Author

@oliviertassinari thanks! Having some issues building material-ui and can't debug it now, will be looking forward to hotfix release! I'd love to see 0.13.1.1, why not!

@oliviertassinari
Copy link
Member

@Webkadabra 0.13.2 may come by the end of the week.

@Webkadabra
Copy link
Author

@oliviertassinari Nice! BTW, just applied fix manually and it works. Thanks!

PS
Are tests not covering server-side rendering bugs? I'm new to JS test writing, just wondering if this is something not trivial to test?

@oliviertassinari
Copy link
Member

@Webkadabra The test coverage is REALLY something that we have to improve. They don't cover the server side rendering.

@Webkadabra
Copy link
Author

Got it!

mnajdova pushed a commit to mnajdova/material-ui that referenced this issue Nov 10, 2020
@zannager zannager added duplicate This issue or pull request already exists docs Improvements or additions to the documentation labels Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants