vercel/next.js · error · Error

Method not implemented.

Error message

Method not implemented.

What it means

Same deliberate unimplemented-stub pattern as the other mock members: the rawHeaders getter (and setTimeout) on the mocked response object throws because no consumer inside Next.js uses it. Encountering it signals the mock is being used beyond the surface it was built for.

Source

Thrown at packages/next/src/server/lib/mock-request.ts:132

  public get complete(): boolean {
    throw new Error('Method not implemented')
  }

  public get trailers(): NodeJS.Dict<string> {
    throw new Error('Method not implemented')
  }

  public get trailersDistinct(): NodeJS.Dict<string[]> {
    throw new Error('Method not implemented')
  }

  public get rawTrailers(): string[] {
    throw new Error('Method not implemented')
  }

  public get rawHeaders(): string[] {
    throw new Error('Method not implemented.')
  }

  public setTimeout(): this {
    throw new Error('Method not implemented.')
  }
}

export interface MockedResponseOptions {
  statusCode?: number
  socket?: Socket | null
  headers?: OutgoingHttpHeaders
  resWriter?: (chunk: Uint8Array | Buffer | string) => boolean
  maximumResponseBody?: number
}

export class MockedResponse extends Stream.Writable implements ServerResponse {
  public statusCode: number
  public statusMessage: string = ''

View on GitHub (pinned to 0eb3775416)

Solutions

  1. Internal mock request limitation; avoid using that method in this code path or upgrade Next.js.
Defensive patterns

Strategy: validation

When it happens

Trigger: An unimplemented method on the mock response object is called.

Common situations: Code calling a response method not supported by the mock request/response shim.


AI-assisted analysis of vercel/next.js@0eb3775416 (2026-08-19). Data as JSON: /api/errors/057affa1a68bf238. Report an issue: GitHub.