Open source changelog

Follow the evolution of Gatsby.

Subscribe to updates
 

Description

https://github.com/gatsbyjs/gatsby/pull/33484 introduced a regression where gatsby-plugin-sharp doesn't init in engine and that result in errors on usage: error Gatsby-plugin-sharp wasn't setup correctly in gatsby-config.js. Make sure you add it to the plugins array.

Currently https://github.com/gatsbyjs/gatsby/blob/3659ec236ad54e87dff26effe11593c5663c31ed/packages/gatsby-plugin-sharp/src/gatsby-node.js#L132-L145

is getting bundled as if (coreSupportsOnPluginInit) { // to properly initialize plugin in worker (`onPreBootstrap` won't run in workers) if (true) {} else {} }

With this change it becomes

if (coreSupportsOnPluginInit) {
  // to properly initialize plugin in worker (`onPreBootstrap` won't run in workers)
  if (true) {
    exports.onPluginInit = async ({
      actions
    }, pluginOptions) => {
      setActions(actions);
      setPluginOptions(pluginOptions);
    };
  } else {}
}