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

bug in ssr in version 1.1.1 #16

Closed
prateekrastogi opened this issue Aug 8, 2017 · 6 comments
Closed

bug in ssr in version 1.1.1 #16

prateekrastogi opened this issue Aug 8, 2017 · 6 comments
Assignees
Labels

Comments

@prateekrastogi
Copy link

Hi,
I recently updated the dependency to 1.1.1 and it seems there is bug in it while performing ssr due use of document to generate default style if none is present.
Here is the code i ran:


 <ApolloProvider client={this.apollo}>
          <UWPThemeProvider
            theme={getTheme({
              themeName: 'dark', // set custom theme
              accent: '#0078D7', // set accent color
              useFluentDesign: true, // sure you want use new fluent design.
              userAgent: this.props.userAgent
            })}>
          <ComposedComponent {...this.props}/>
          </UWPThemeProvider>
        </ApolloProvider>

The error thrown while fetching the ssr page is:

ReferenceError: document is not defined
at StyleManager.setupStyleElement (C:\Code\consert\frontend\node_modules\react-uwp\styles\StyleManager.js:37:38)
at new StyleManager (C:\Code\consert\frontend\node_modules\react-uwp\styles\StyleManager.js:120:14)
at Theme._this.bindNewThemeMethods (C:\Code\consert\frontend\node_modules\react-uwp\Theme\index.js:130:32)
at Theme.render (C:\Code\consert\frontend\node_modules\react-uwp\Theme\index.js:326:14)
at C:\Code\consert\frontend\node_modules\react-dom\lib\ReactCompositeComponent.js:795:21

Note that issue happens only while doing ssr. While this code works perfectly fine with version 1.1.0

@myxvisual
Copy link
Owner

@prateekrastogi Thanks for feedback, I will be in the next version of the server rendering to fix this bug.

@myxvisual
Copy link
Owner

@prateekrastogi hi, i think i fixed this bugs, if you have tested your project without error, you can close this issue, ty.

@prateekrastogi
Copy link
Author

Yeah, it's working properly. Thanks a lot

@prateekrastogi
Copy link
Author

@myxvisual Hi,
I have a doubt in docs about ssr it is written to use this flag too needGenerateAcrylic={false} . But, I am using acrylic texture in my ui layout . Also, right now i didn't set it to any value i.e. default. Is it necessary to set to false? What are the implications of it being true on ssr?

@myxvisual
Copy link
Owner

@prateekrastogi Because the effect of acrylic material is generated by the canvas, the Node environment does not support canvas, should be unable to generate and error.

@prateekrastogi
Copy link
Author

Thanks

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

2 participants