You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As utilized in @pieh's update to gatsby-plugin-jss the wrapRootElement from both gatsby-browser.js and gatsby-ssr.js seem to be applied when running a build.
This results in errors on the build because the ssr version effectively gets both. (The gatsby-browser.js removes the ssr version in onInitialClientRender)
It seems counter-intuitive that all wrapRootElement exports are always applied regardless of browser/ssr rendering.
As a workaround, commenting out gatsby-browser.js works for gatsby build.
Steps to reproduce
Presumably the using-jss example exhibits this issue. If not, I can work on a reproduction.
Expected result
I'd expect that the gatsby develop version would only load wrapRootElement functions from gatsby-browser.js, while gatsby build would only load wrapRootElement functions from gatsby-ssr.js.
Actual result
All wrapRootElement functions seem to be applied regardless of where they're exported from.
So the real underlying issue that I'm having is that when the Javascript / browser rendering happens, new styles are added overriding the existing classes... But the classNames of the elements are not modified.
Potentially the reason this doesn't happen with the "using-jss" example is that it's relatively simple.
Description
As utilized in @pieh's update to gatsby-plugin-jss the
wrapRootElement
from bothgatsby-browser.js
andgatsby-ssr.js
seem to be applied when running a build.This results in errors on the build because the ssr version effectively gets both. (The
gatsby-browser.js
removes the ssr version inonInitialClientRender
)It seems counter-intuitive that all
wrapRootElement
exports are always applied regardless of browser/ssr rendering.As a workaround, commenting out
gatsby-browser.js
works forgatsby build
.Steps to reproduce
Presumably the using-jss example exhibits this issue. If not, I can work on a reproduction.
Expected result
I'd expect that the
gatsby develop
version would only loadwrapRootElement
functions fromgatsby-browser.js
, whilegatsby build
would only loadwrapRootElement
functions fromgatsby-ssr.js
.Actual result
All
wrapRootElement
functions seem to be applied regardless of where they're exported from.Environment
File contents (if changed)
gatsby-config.js
: N/Apackage.json
: N/Agatsby-node.js
: N/Agatsby-browser.js
: N/Agatsby-ssr.js
: N/AThe text was updated successfully, but these errors were encountered: