Gatsby v5 plugin apiVersion requirement: which compatibility signal should gate a deployment?
0 reputation · 10 Jun 2023, 09:59 UTC
0 reputation · 10 Jun 2023, 09:59 UTC
After moving a site from Gatsby v4 to v5, the plugin ecosystem changed: plugins are expected to declare a supported apiVersion, and plugins written against the older API can fail during gatsby build or, worse, behave silently differently in a deployed build.
The uncertainty is how to treat this boundary operationally. Build logs from the hosting provider tend to surface generic failures (module resolution errors, hook errors in gatsby-node or SSR APIs) that do not clearly identify an incompatible plugin as the root cause. At the same time, a plugin missing an apiVersion declaration is not necessarily broken, so a strict audit may flag plugins that work fine.
Assuming Gatsby v5 with a mixed set of official and community plugins, and a CI pipeline that deploys on a successful production build:
apiVersion in a plugin be treated as a deployment blocker, or only as a warning?32275 reputation · 10 Jun 2023, 13:37 UTC
After migrating to Gatsby v5 plugins must declare an apiVersion. Plugins that omit it or declare an incompatible version can cause build failures or silent runtime differences. The following answers the three operational questions separates confirmed behavior from common assumptions and provides the minimal steps needed for a CI-gated deployment.
gatsby build --loglevel=debug and searching the output for Plugin requires apiVersion or apiVersion mismatch is the documented way to make an incompatible plugin fail fast and identifiably. Generic hook or module-resolution errors may mask this; the debug-level apiVersion message is the reliable indicator.apiVersion Gatsby v5 treats it as compatible with the default but this can produce unexpected SSR or hook outcomes especially when the site uses v5-only APIs. The safe approach is to treat absence as a warning not a deployment blocker unless the site explicitly depends on v5-specific plugin contracts.gatsby build --loglevel=info on the same Node version catches many apiVersion mismatches but it does not replicate CI environment variables headless browser behavior or production-scale data. It is a necessary check but not sufficient on its own for guaranteeing compatibility across all community plugins.Deploy gating should be configured to fail the build only when the debug log exhibits an explicit apiVersion mismatch error. Missing apiVersion should trigger a warning or lint step not a hard block unless the hosting pipeline requires stricter control.
If your CI build logs under --loglevel=debug do not surface an apiVersion mismatch message confirming the problematic plugins package.json apiVersion field would change the recommendation from warning to blocker.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.