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

chore(gatsby-admin): fix built html not having layout wrappers #26355

Merged
merged 1 commit into from
Aug 11, 2020

Conversation

mxstbr
Copy link
Contributor

@mxstbr mxstbr commented Aug 11, 2020

We have a wrapPageElement method in gatsby-browser.js that wraps every page in our <Layout /> component, which adds some global styling and wraps the page in all kinds of context providers—most notably, the theme providers!

So far, that worked fine and looked alright. However, we started using some gatsby-interface components that rely on the theme being in the context during gatsby build. That suddenly broke the build process with errors such as this and this, yet the develop process kept working fine.

I realised this morning that the fix is as simple as also adding the wrapPageElement to gatsby-ssr.js! 🤦 This unblocks #26195 and #26243.

@mxstbr mxstbr requested a review from laurieontech August 11, 2020 08:54
@mxstbr mxstbr requested a review from a team as a code owner August 11, 2020 08:54
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Aug 11, 2020
@gatsby-cloud-staging
Copy link

Gatsby Cloud Build Report

🚩 Your build failed. See the build logs here

Errors

Error in "/usr/src/app/www/examples/gatsbygram/node_modules/gatsby-plugin-page-creator/gatsby-node.js": Cannot find module 'gatsby-cli/lib/reporter'
Require stack:
- /usr/src/app/www/examples/gatsbygram/node_modules/gatsby-plugin-page-creator/is-valid-collection-path-implementation.js
- /usr/src/app/www/examples/gatsbygram/node_modules/gatsby-plugin-page-creator/create-pages-from-collection-builder.js
- /usr/src/app/www/examples/gatsbygram/node_modules/gatsby-plugin-page-creator/create-page-wrapper.js
- /usr/src/app/www/examples/gatsbygram/node_modules/gatsby-plugin-page-creator/gatsby-node.js
- /usr/src/app/www/examples/gatsbygram/node_modules/gatsby/dist/bootstrap/resolve-module-exports.js
- /usr/src/app/www/examples/gatsbygram/node_modules/gatsby/dist/bootstrap/load-plugins/validate.js
- /usr/src/app/www/examples/gatsbygram/node_modules/gatsby/dist/bootstrap/load-plugins/load.js
- /usr/src/app/www/examples/gatsbygram/node_modules/gatsby/dist/bootstrap/load-plugins/index.js
- /usr/src/app/www/examples/gatsbygram/node_modules/gatsby/dist/services/initialize.js
- /usr/src/app/www/examples/gatsbygram/node_modules/gatsby/dist/services/index.js
- /usr/src/app/www/examples/gatsbygram/node_modules/gatsby/dist/bootstrap/index.js
- /usr/src/app/www/examples/gatsbygram/node_modules/gatsby/dist/commands/build.js
- /usr/src/app/www/examples/gatsbygram/node_modules/gatsby/node_modules/gatsby-cli/lib/create-cli.js
- /usr/src/app/www/examples/gatsbygram/node_modules/gatsby/node_modules/gatsby-cli/lib/index.js
- /usr/src/app/www/examples/gatsbygram/node_modules/gatsby/dist/bin/gatsby.js
- /usr/src/app/www/examples/gatsbygram/node_modules/gatsby/cli.js

@gatsby-cloud
Copy link

gatsby-cloud bot commented Aug 11, 2020

Gatsby Cloud Build Report

🚩 Your build failed. See the build logs here

Errors

Error in "/usr/src/app/www/www/node_modules/gatsby-plugin-page-creator/gatsby-node.js": Cannot find module 'gatsby-cli/lib/reporter'
Require stack:
- /usr/src/app/www/www/node_modules/gatsby-plugin-page-creator/is-valid-collection-path-implementation.js
- /usr/src/app/www/www/node_modules/gatsby-plugin-page-creator/create-pages-from-collection-builder.js
- /usr/src/app/www/www/node_modules/gatsby-plugin-page-creator/create-page-wrapper.js
- /usr/src/app/www/www/node_modules/gatsby-plugin-page-creator/gatsby-node.js
- /usr/src/app/www/www/node_modules/gatsby/dist/bootstrap/resolve-module-exports.js
- /usr/src/app/www/www/node_modules/gatsby/dist/bootstrap/load-plugins/validate.js
- /usr/src/app/www/www/node_modules/gatsby/dist/bootstrap/load-plugins/load.js
- /usr/src/app/www/www/node_modules/gatsby/dist/bootstrap/load-plugins/index.js
- /usr/src/app/www/www/node_modules/gatsby/dist/services/initialize.js
- /usr/src/app/www/www/node_modules/gatsby/dist/services/index.js
- /usr/src/app/www/www/node_modules/gatsby/dist/bootstrap/index.js
- /usr/src/app/www/www/node_modules/gatsby/dist/commands/build.js
- /usr/src/app/www/www/node_modules/gatsby/node_modules/gatsby-cli/lib/create-cli.js
- /usr/src/app/www/www/node_modules/gatsby/node_modules/gatsby-cli/lib/index.js
- /usr/src/app/www/www/node_modules/gatsby/dist/bin/gatsby.js
- /usr/src/app/www/www/node_modules/gatsby/cli.js

@mxstbr
Copy link
Contributor Author

mxstbr commented Aug 11, 2020

Gatsby Cloud build failures are unrelated, they are happening in master right now.

@laurieontech
Copy link
Contributor

Not sure what the cloud errors are but shouldn't be this PR that caused them. Glad you found this!

@laurieontech laurieontech merged commit ed8dc95 into master Aug 11, 2020
@johno johno deleted the admin/fix-build branch August 11, 2020 12:17
@pvdz pvdz removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Aug 11, 2020
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

Successfully merging this pull request may close these issues.

3 participants