jestjs/jest · error · Error
Farm is ended, no more calls can be done to it
Error message
Farm is ended, no more calls can be done to it
What it means
Error "Farm is ended, no more calls can be done to it" thrown in jestjs/jest.
Source
Thrown at packages/jest-worker/src/index.ts:161
continue;
}
// eslint-disable-next-line no-prototype-builtins
if (this.constructor.prototype.hasOwnProperty(name)) {
throw new TypeError(`Cannot define a method called ${name}`);
}
// @ts-expect-error: dynamic extension of the class instance is expected.
this[name] = this._callFunctionWithArgs.bind(this, name);
}
}
private _callFunctionWithArgs(
method: string,
...args: Array<unknown>
): Promise<unknown> {
if (this._ending) {
throw new Error('Farm is ended, no more calls can be done to it');
}
return this._farm.doWork(method, ...args);
}
getStderr(): NodeJS.ReadableStream {
return this._workerPool.getStderr();
}
getStdout(): NodeJS.ReadableStream {
return this._workerPool.getStdout();
}
async start(): Promise<void> {
await this._workerPool.start();
}
async end(): Promise<PoolExitResult> {View on GitHub (pinned to f49721c78e)
Solutions
- The worker farm has been shut down (end() was called). Do not call worker methods after calling farm.end(); create a new Worker instance if you need to run more tasks.
When it happens
Trigger: Thrown at packages/jest-worker/src/index.ts:161 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of jestjs/jest@f49721c78e (2026-08-03).
Data as JSON: /data/errors/285cdc3abf0f145b.json.
Report an issue: GitHub.