vercel/next.js · error · Error

request failed with empty body

Error message

request failed with empty body

What it means

Download integrity failure in extractBinary: the registry responded ok but with no response body, so there is nothing to stream to the temp file for the SWC package tarball. This catches the degenerate case where the status alone looked successful.

Solutions

  1. Retry the download; if persistent, install the platform-specific @next/swc package manually.
Defensive patterns

Strategy: retry

When it happens

Trigger: The SWC binary download response body is empty.

Common situations: A proxy or interrupted connection returns an empty body during SWC download.


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

Appendix: source

Thrown at packages/next/src/lib/download-swc.ts:51

      cacheDirectory,
      `${tarFileName}.temp-${Date.now()}`
    )

    const registry = getRegistry()

    const downloadUrl = `${registry}${pkgName}/-/${tarFileName}`

    await fetch(downloadUrl).then((res) => {
      const { ok, body } = res
      if (!ok || !body) {
        Log.error(`Failed to download swc package from ${downloadUrl}`)
      }

      if (!ok) {
        throw new Error(`request failed with status ${res.status}`)
      }
      if (!body) {
        throw new Error('request failed with empty body')
      }
      const cacheWriteStream = fs.createWriteStream(tempFile)
      return body.pipeTo(
        new WritableStream({
          write(chunk) {
            return new Promise<void>((resolve, reject) =>
              cacheWriteStream.write(chunk, (error) => {
                if (error) {
                  reject(error)
                  return
                }

                resolve()
              })
            )
          },
          close() {
            return new Promise<void>((resolve, reject) =>

View on GitHub (pinned to 0eb3775416)