Describe the bug
I'm using GatsbyJS to build a site with SDDS. Doing a production build of the site with gatsby build fails because during the Gatsby production build the window object is undefined, and there are dependencies in SDDS which does not take this into account. What's needed in SDDS is some checks that typeof(window) !== 'undefined'.
As a consequence of this I need to add code which excludes SDDS during my production build step, but it gives some drawback since the SSR pages do not include stylings from SDDS, and I need to make sure I render my UI only after everything has mounted.
To Reproduce
Clone a GatsbyJS starter
Add SDDS dependencies and include the setup in gatsby-browser.js and gatsby-ssr.js.
Start the development server. Site renders nicely on http://localhost:8000
Run gatsby build. Error.
Expected behavior
A successful gatsby build for a GatsbyJS site using SDDS.
Describe the bug
I'm using GatsbyJS to build a site with SDDS. Doing a production build of the site with
gatsby build
fails because during the Gatsby production build thewindow
object is undefined, and there are dependencies in SDDS which does not take this into account. What's needed in SDDS is some checks thattypeof(window) !== 'undefined'
.As a consequence of this I need to add code which excludes SDDS during my production build step, but it gives some drawback since the SSR pages do not include stylings from SDDS, and I need to make sure I render my UI only after everything has mounted.
To Reproduce
http://localhost:8000
gatsby build
. Error.Expected behavior
A successful
gatsby build
for a GatsbyJS site using SDDS.Version of Corporate-ui
4.1.2
Framework and version
Application link