npm / gatsby
gatsby
What changed in gatsby 3 to 5, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-14.
71 breaking7 deprecations14 new APIs and options4 performance13 behavior and defaults3 tooling5 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initgatsby 519 changes
Breaking changes 6
Gatsby Partial Hydration is incompatible with React 19; users relying on it should not upgrade to React 19.
Gatsby 2 and Gatsby 3 are no longer officially supported as of Gatsby 5.
Gatsby 5 drops support for Node 14 and 16 and moves to Node 18.
Non-ESM browsers are no longer polyfilled by default, speeding up production JavaScript and CSS bundle builds.
React 18 is the new minimum required version; official support for React 16 and 17 is dropped.
React 18 is listed as a major dependency update.
New APIs and options 6
Export this callback from gatsby-browser.js to handle errors caught by error boundaries in React 19.
Export this callback from gatsby-browser.js to handle uncaught errors in React 19.
The createSlice action in the createPages API defines shared components that Gatsby can build once and stitch into pages, reducing rebuilds when those components change.
Partial Hydration (Beta) lets developers selectively add interactivity to an otherwise static app; it is opt-in and requires experimental react and react-dom versions.
The Slice placeholder replaces a shared component in a page so Gatsby can stitch in its separately built markup and JavaScript.
Add the use client directive to components that need to be client components when using Partial Hydration.
Performance 2
Changes to sort and aggregation fields reduce resource usage, significantly reduce memory usage, and speed up the “Building schema” step.
This release includes performance improvements.
Behavior and default changes 3
React 19's document metadata hoisting feature is disabled in Gatsby because it conflicts with the Gatsby Head API.
Gatsby now officially supports Node.js 24.
Gatsby and Gatsby-maintained packages officially support React 19; existing stable functionality is intended to work, and React 18 remains supported.
Tooling 1
Gatsby updates its integrated GraphQL development environment to GraphiQL v2, bringing dark mode, tabs, persisted state, improved documentation search and markdown support, and a plugin ecosystem.
Fixes and other changes 1
Fixes regressions in the Gatsby Head API, including cases where <title> did not update document.title.
gatsby 444 changes
Breaking changes 28
For DSG and SSR, external files required through fs in specified lifecycle APIs are not included in bundles; move their contents to an imported JS/TS file.
Gatsby 4 with LMDB no longer supports circular references in data.
Pass the full node to
deleteNodeinstead of a string node ID.Remove this gatsby-config flag; the feature is part of Gatsby core and can no longer be enabled or disabled with the flag.
Remove this gatsby-config flag; the feature is part of Gatsby core and can no longer be enabled or disabled with the flag.
gatsby-admin is no longer available in Gatsby; its experimental activation environment variable is also no longer usable.
This environment variable no longer activates gatsby-admin, which was removed from Gatsby.
The feeds option is now required.
The serialize key inside feeds is now required; define your own serialize function if you previously relied on the default.
The title key inside feeds is now required.
The sizeByPixelDensity option was removed.
The sizeByPixelDensity option was removed.
The sizeByPixelDensity option was removed.
The transformer maps the input id key to jsonId and uses an internally generated UUID for the node id; update GraphQL queries that used id.
The transformer maps the input id key to yamlId and uses an internally generated UUID for the node id; update GraphQL queries that used id.
Use interface inheritance instead of @nodeInterface to implement queryable interfaces.
Remove this gatsby-config flag; the feature is part of Gatsby core and can no longer be enabled or disabled with the flag.
Nodes are persisted after createNode; direct mutations afterward are lost, so use Gatsby actions such as createNodeField.
Gatsby 4 drops support for Node 12; Node.js 14.15.0 or newer is required because lmdb-store requires >=14.15.0.
Interface inheritance replaces @nodeInterface as the way to implement queryable interfaces.
Remove this gatsby-config flag; the feature is part of Gatsby core and can no longer be enabled or disabled with the flag.
This environment variable is removed; pass stage as an option to gatsby-preset-gatsby instead.
Remove this gatsby-config flag; the feature is part of Gatsby core and can no longer be enabled or disabled with the flag.
Run reporter.setErrorMap inside onPluginInit instead of onPreInit.
SitePage now exposes pageContext as JSON rather than inferring individual context fields; queries can no longer select those fields individually.
Schema-related actions can no longer be used in sourceNodes; move them to createSchemaCustomization or use createResolvers.
Pass the full node to
touchNodeinstead of a string node ID.Gatsby 4 does not support WSL1 instances because of an upstream lmdb-store issue; the notes recommend updating to WSL2.
Deprecations 4
The ___NODE relation convention is deprecated; @link is the preferred method for defining relations between nodes.
Use findOne as a replacement for runQuery.
nodeModel.getAllNodes is deprecated; use nodeModel.findAll, preferably restricting the number of fetched nodes.
nodeModel.runQuery is deprecated; use nodeModel.findAll and nodeModel.findOne instead.
New APIs and options 6
Gatsby 4 introduces Deferred Static Generation as a new rendering option.
Use findAll as a replacement for runQuery and getAllNodes; it returns an iterable and supports limit and skip.
Use onPluginInit to share initial plugin state with lifecycle APIs; it runs in each worker as it is initialized.
Gatsby 4 introduces Server-Side Rendering as a new rendering option.
The built-in SitePlugin type gains a packageJson field of type JSON.
The built-in SitePlugin type gains a pluginOptions field of type JSON.
Performance 2
The page-renderer size is reduced.
Page queries and static queries can run in parallel, reducing build times by up to 40% for some sites.
Behavior and default changes 3
Do not create nodes in custom resolvers; create nodes in sourceNodes instead.
The WordPress source plugin uses gatsby-plugin-image.
A queue was added to prefetching, making it less eager.
Tooling 1
The build output now identifies pages as SSG, DSG, SSR, or a Gatsby Function.
gatsby 354 changes
Breaking changes 37
The deprecated API is removed; rename its instances to
actionsto keep the same behavior.Types with disabled inference must explicitly declare a parent-child relationship to provide child fields.
The
manyargument is no longer needed for thechildOfdirective.The
fieldNameandfieldValuearguments are removed; usenameandvalueinstead.CSS Modules are imported as ES Modules, for example by importing named class exports from the module stylesheet.
The deprecated API is removed; iterate over the nodes and call
deleteNodeinstead.Gatsby upgrades ESLint from version 6 to version 7; sites with custom ESLint configuration should check the migration guide.
Gatsby replaces eslint-loader with eslint-webpack-plugin; warnings and errors are displayed later than in version 2.
The deprecated key is removed from gatsby-config.js; define Gatsby themes inside the
pluginsarray instead.A new gatsby-core-utils utility supersedes file download utilities from gatsby-source-filesystem.
File assets such as fonts and PDFs are handled as ES Modules; replace require functions with imports.
If Gatsby discovers fs modules are used, it disables incremental-build mode as a safety measure.
A new plugin is required for Gatsby Cloud Hosting; it generates redirects and rewrites for client-side routes and supports custom per-file headers.
The plugin is deprecated and is not compatible with Gatsby v3.
A new image plugin replaces gatsby-image and provides a simplified GraphQL API and the StaticImage component.
When using tableOfContents, absolute now defaults to false.
When using tableOfContents, pathToSlugField now defaults to an empty string.
This gatsby-browser API is removed; use
loadPageinstead.This gatsby-browser API is removed; use
loadPageSyncinstead.Queries can no longer use the global tag without importing it; import
graphqlfrom Gatsby.This API is removed from the public API surface because Gatsby now checks internally whether a node has changed.
The deprecated gatsby-link API is removed; use
navigateinstead.The minimum required Node.js version is 12.13.0; Node 10 is no longer supported.
Remove this argument from inference directives.
With
firstOnly: falseor unset, no results now return an empty array instead ofnull.The deprecated API is removed; rename its instances to
pageContext.Replace
process.browserchecks in components with a check for whetherwindowis undefined.The deprecated gatsby-link API is removed; use
navigateinstead.Gatsby is compatible with React 17, and its minimum React version is now 16.9.0 to support Fast Refresh, Hooks, and Suspense by default.
GraphQL regex filters require backslashes to be escaped once instead of twice.
The deprecated gatsby-link API is removed; use
navigateinstead.This gatsby-browser API is removed; use
wrapPageElementinstead.When defining a field of complex type, explicitly assign the corresponding extension or a custom resolver.
ScrollContainer has been removed; use the useScrollRestoration hook instead.
Queries for abstract types must request
__typenameexplicitly; Gatsby no longer adds it automatically.Gatsby upgrades webpack from version 4 to version 5, which can require changes for Gatsby plugins and webpack plugins.
webpack no longer automatically polyfills Node APIs such as
pathandfsin the browser; configure them manually.
Deprecations 3
Passing
nodeas a named argument is deprecated in favor of passing the full node to the function.The directive is deprecated in favor of interface inheritance.
Passing
nodeIdas a named argument is deprecated in favor of passing the full node.
New APIs and options 2
Accepts reactImportSource and passes it to @babel/preset-react's importSource field; it is supported only when reactRuntime is automatic.
The plugin now supports the topLevelImportPaths option.
Behavior and default changes 7
Keep the .cache and public directories from previous builds to use incremental builds.
Fast Refresh is the default overlay, replacing react-hot-loader and preserving state across re-renders while improving error handling.
gatsby-plugin-image reaches its 1.0.0 release.
The plugin adds retries when downloading assets and on network errors, and supports gatsby-plugin-image.
Gatsby now displays GraphQL deprecations as CLI warnings.
Gatsby introduces incremental HTML builds that track inputs used to generate HTML; using
fsin gatsby-ssr.js disables this feature.JSON modules allow importing only the default export; importing sub-properties produces a warning.
Tooling 1
The default ESLint configuration adds rules warning against anonymous default exports and page templates with more than one default export.
Fixes and other changes 4
The plugin now validates its options.
Fixes an HTML field gatsby-image regression that prevented image transforms in certain situations.
AVIF images are now cached.
Page invalidations are no longer missed when runQuery is used in custom resolvers.