{"record":{"id":"99cc2127ce40a5fa","repo":"gatsbyjs/gatsby","slug":"no-worker-function-found-for-job-name","errorCode":null,"errorMessage":"No worker function found for ${job.name}","messagePattern":"No worker function found for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby/src/utils/jobs/manager.ts","lineNumber":162,"sourceCode":"  process.send!(jobCreatedMessage)\n\n  return deferred.promise\n}\n\n/**\n * Make sure we have everything we need to run a job\n * If we do, run it locally.\n * TODO add external job execution through ipc\n */\nfunction runJob(\n  job: InternalJob,\n  forceLocal = false\n): Promise<Record<string, unknown>> {\n  const { plugin } = job\n  try {\n    return importGatsbyPlugin(plugin, `gatsby-worker`).then(worker => {\n      if (!worker[job.name]) {\n        throw new Error(`No worker function found for ${job.name}`)\n      }\n\n      if (!forceLocal && !job.plugin.isLocal && hasExternalJobsEnabled()) {\n        if (process.send) {\n          if (!isListeningForMessages) {\n            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          }","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/packages/gatsby/src/utils/jobs/manager.ts#L144-L180","documentation":"runJob dynamically imports the plugin's gatsby-worker module and indexes it by job.name. If no exported function with that name exists, it throws. The job name must exactly match a named export of the plugin's gatsby-worker.js.","triggerScenarios":"A plugin queues a job whose name does not match a named export in its gatsby-worker.js (e.g. enqueueing 'PROCESS_IMAGE' but the worker exports 'processImage').","commonSituations":"Plugin version mismatch (job renamed across versions); typo in job name; renamed worker export without updating enqueue sites.","solutions":["Ensure gatsby-worker.js exports a function whose name exactly equals the enqueued job.name.","Update the plugin to a version whose worker exports match the job name.","Fix the casing/spelling of the job name at the enqueue call site."],"exampleFix":"// before: enqueue uses 'PROCESS_IMAGE', worker exports 'processImage'\n// gatsby-worker.js\nmodule.exports = { processImage: require('./worker').processImage }\n// after: align names\nmodule.exports = { PROCESS_IMAGE: require('./worker').processImage }","handlingStrategy":"validation","validationCode":"async function workerHasJob(plugin, jobName) {\n  const worker = await importGatsbyPlugin(plugin, 'gatsby-worker')\n  return typeof worker[jobName] === 'function'\n}","typeGuard":"function workerExportsJob(worker, name) { return typeof worker?.[name] === 'function' }","tryCatchPattern":null,"preventionTips":["Keep job names and worker export names identical and in a shared constants module.","Add a unit test asserting the worker exports every job name the plugin enqueues.","Version plugins so job/worker names stay in sync across releases."],"tags":["jobs","worker","plugin"],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}