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: Upgrade Gatsby #138

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions gatsby-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const gatsbyConfig: GatsbyConfig = {
},
flags: {
FAST_DEV: true,
DEV_SSR: false,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out of curiosity: why is it false?

Now you can add the DEV_SSR flag to your gatsby-config file so you can spot and fix SSR errors (like trying to access the window object) during development.

https://www.gatsbyjs.com/docs/reference/release-notes/v4.18/#notable-bugfixes--improvements:~:text=spot%20and%20fix%20SSR%20errors

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when I enable devSSR everything breaks with a hydration mismatch error. Somehow Gatsby does not render the page.tx, only the layout.tsx, creating this mismatch

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's too bad because this seems like a useful feature. :(

Just the other day, a store was using an unprotected window call inside the PDP that was causing an SSR error, but it did not error during development. It errored (window is not defined) only if they built & served. It feels like with this flag, it would have errored earlier during development.

PARALLEL_SOURCING: true,
},
plugins: [
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
"@faststore/graphql-utils": "^1.10.6",
"@faststore/sdk": "^1.10.6",
"@faststore/ui": "^1.10.6",
"gatsby": "^4.16.0",
"gatsby-plugin-gatsby-cloud": "^4.16.0",
"gatsby-plugin-manifest": "^4.16.0",
"gatsby": "^4.18.0",
"gatsby-plugin-gatsby-cloud": "^4.18.0",
"gatsby-plugin-manifest": "^4.18.0",
"gatsby-plugin-netlify": "^5.0.0",
"gatsby-plugin-next-seo": "^1.10.0",
"gatsby-plugin-nprogress": "^4.16.0",
"gatsby-plugin-nprogress": "^4.18.0",
"gatsby-plugin-robots-txt": "^1.7.1",
"gatsby-plugin-root-import": "^2.0.8",
"gatsby-plugin-sass": "^5.16.0",
"gatsby-plugin-sass": "^5.18.0",
"gatsby-plugin-webpack-bundle-analyser-v2": "^1.1.27",
"include-media": "^1.4.10",
"react": "^18.2.0",
Expand Down
Loading