gatsbyjs/gatsby · error
No worker function found for ${job.name}
Error message
No worker function found for ${job.name} What it means
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.
Source
Thrown at packages/gatsby/src/utils/jobs/manager.ts:162
process.send!(jobCreatedMessage)
return deferred.promise
}
/**
* Make sure we have everything we need to run a job
* If we do, run it locally.
* TODO add external job execution through ipc
*/
function runJob(
job: InternalJob,
forceLocal = false
): Promise<Record<string, unknown>> {
const { plugin } = job
try {
return importGatsbyPlugin(plugin, `gatsby-worker`).then(worker => {
if (!worker[job.name]) {
throw new Error(`No worker function found for ${job.name}`)
}
if (!forceLocal && !job.plugin.isLocal && hasExternalJobsEnabled()) {
if (process.send) {
if (!isListeningForMessages) {
isListeningForMessages = true
listenForJobMessages()
}
return runExternalWorker(job)
} else {
// only show the offloading warning once
if (!hasShownIPCDisabledWarning) {
hasShownIPCDisabledWarning = true
reporter.warn(
`Offloading of a job failed as IPC could not be detected. Running job locally.`
)
}View on GitHub (pinned to 8b06340921)
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.
Example fix
// before: enqueue uses 'PROCESS_IMAGE', worker exports 'processImage'
// gatsby-worker.js
module.exports = { processImage: require('./worker').processImage }
// after: align names
module.exports = { PROCESS_IMAGE: require('./worker').processImage } Defensive patterns
Strategy: validation
Validate before calling
async function workerHasJob(plugin, jobName) {
const worker = await importGatsbyPlugin(plugin, 'gatsby-worker')
return typeof worker[jobName] === 'function'
} Type guard
function workerExportsJob(worker, name) { return typeof worker?.[name] === 'function' } Prevention
- 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.
When it happens
Trigger: 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').
Common situations: Plugin version mismatch (job renamed across versions); typo in job name; renamed worker export without updating enqueue sites.
Related errors
- We couldn't find a gatsby-worker.js(${plugin.resolve}/gatsby
- Result of a worker should be an object, type of "${typeof re
- An ID must be provided when creating or setting job
- An ID must be provided when ending a job
- The plugin "${_.get(action, `plugin.name`, `anonymous`)}" tr
AI-assisted analysis of gatsbyjs/gatsby@8b06340921 (2026-08-13).
Data as JSON: /api/errors/99cc2127ce40a5fa.
Report an issue: GitHub.