{"record":{"id":"bed4240a733f1dc9","repo":"gatsbyjs/gatsby","slug":"we-couldn-t-find-a-gatsby-worker-js-plugin-resol","errorCode":null,"errorMessage":"We couldn't find a gatsby-worker.js(${plugin.resolve}/gatsby-worker.js) file for ${plugin.name}@${plugin.version}","messagePattern":"We couldn't find a gatsby-worker\\.js\\((.+?)/gatsby-worker\\.js\\) file for (.+?)@(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby/src/utils/jobs/manager.ts","lineNumber":186,"sourceCode":"            isListeningForMessages = true\n            listenForJobMessages()\n          }\n\n          return runExternalWorker(job)\n        } else {\n          // only show the offloading warning once\n          if (!hasShownIPCDisabledWarning) {\n            hasShownIPCDisabledWarning = true\n            reporter.warn(\n              `Offloading of a job failed as IPC could not be detected. Running job locally.`\n            )\n          }\n        }\n      }\n      return runLocalWorker(worker[job.name], job)\n    })\n  } catch (err) {\n    throw new Error(\n      `We couldn't find a gatsby-worker.js(${plugin.resolve}/gatsby-worker.js) file for ${plugin.name}@${plugin.version}`\n    )\n  }\n}\n\nfunction isInternalJob(job: JobInput | InternalJob): job is InternalJob {\n  return (\n    (job as InternalJob).id !== undefined &&\n    (job as InternalJob).contentDigest !== undefined\n  )\n}\n\n/**\n * Create an internal job object\n */\nexport function createInternalJob(\n  job: JobInput | InternalJob,\n  plugin: { name: string; version: string; resolve: string }","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/packages/gatsby/src/utils/jobs/manager.ts#L168-L204","documentation":"runJob wraps importGatsbyPlugin(plugin, 'gatsby-worker') in a try/catch; any failure (module not found, require-time error) is re-thrown as this generic message. It means the plugin ships no loadable gatsby-worker.js at plugin.resolve, or that file threw on require.","triggerScenarios":"The plugin package lacks gatsby-worker.js at its root; plugin.resolve points to the wrong directory; the worker module itself throws at require-time.","commonSituations":"Missing worker file in the published package; monorepo/yarn-link resolution issue; broken plugin install; worker file has a syntax/runtime error during load.","solutions":["Reinstall the plugin (npm/yarn install) so gatsby-worker.js is present.","Confirm gatsby-worker.js exists at plugin.resolve and is a valid CommonJS module.","Upgrade or pin a plugin version known to ship the worker file.","Open the worker file in node to see the underlying require error and fix it."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const fs = require('fs')\nconst path = require('path')\nfunction pluginHasWorkerFile(plugin) {\n  return fs.existsSync(path.join(plugin.resolve, 'gatsby-worker.js'))\n}","typeGuard":"function workerFileResolves(plugin) {\n  try { require.resolve(path.join(plugin.resolve, 'gatsby-worker.js')); return true } catch { return false }\n}","tryCatchPattern":null,"preventionTips":["Confirm gatsby-worker.js ships in the published plugin package (check files field).","Pin plugin versions known to include the worker file.","Run a smoke require of the worker during plugin tests."],"tags":["jobs","worker","plugin"],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}