nestjs/nest · error · Error
Method is not supported in gRPC mode.
Error message
Method is not supported in gRPC mode.
What it means
Error "Method is not supported in gRPC mode." thrown in nestjs/nest.
Source
Thrown at packages/microservices/server/server-grpc.ts:340
const handler = methodHandler(call.request, call.metadata, call);
const result$ = this.transformToObservable(await handler);
await this.writeObservableToGrpc(result$, call);
this.onProcessingEndHook?.(this.transportId, call.request);
},
);
};
}
public unwrap<T>(): T {
throw new Error('Method is not supported for gRPC transport');
}
public on<
EventKey extends string | number | symbol = string | number | symbol,
EventCallback = any,
>(event: EventKey, callback: EventCallback) {
throw new Error('Method is not supported in gRPC mode.');
}
/**
* Writes an observable to a GRPC call.
*
* This function will ensure that backpressure is managed while writing values
* that come from an observable to a GRPC call.
*
* @param source The observable we want to write out to the GRPC call.
* @param call The GRPC call we want to write to.
* @returns A promise that resolves when we're done writing to the call.
*/
private writeObservableToGrpc<T>(
source: Observable<T>,
call: GrpcCall<T>,
): Promise<void> {
// This promise should **not** reject, as we're handling errors in the observable for the Call
// the promise is only needed to signal when writing/draining has been completedView on GitHub (pinned to 6ec0e2783d)
Solutions
- Do not call this method on a gRPC server instance; gRPC transport does not support it.
- Use the ServerGrpc-specific API (e.g. getClient/getService) or a transport that supports the operation instead.
- Remove the call from code paths that run when the microservice uses Transport.GRPC.
Example fix
// Guard by transport before calling unsupported methods
if (app.get(MicroserviceOptions).transport !== Transport.GRPC) {
server.on('error', handler);
} When it happens
Trigger: Thrown at packages/microservices/server/server-grpc.ts:340 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of nestjs/nest@6ec0e2783d (2026-08-03).
Data as JSON: /data/errors/791ef530662401a0.json.
Report an issue: GitHub.