vercel/next.js · error · Error

Unknown source map type for

Error message

Unknown source map type for ${filename}: ${buffer.typeFull}.

What it means

Content-type check on an inline source map: the decoded data: URI buffer's MIME type is not application/json, so it cannot be a valid source map payload. It indicates the data URI was mis-decoded or the artifact embeds a non-JSON payload where a map should be.

Solutions

  1. Provide a source map as a JSON file or data URL; the detected type is unsupported.
Defensive patterns

Strategy: validation

When it happens

Trigger: A source map has an unrecognized type.

Common situations: A third-party tool emits a source map format the dev server does not understand.


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

Appendix: source

Thrown at packages/next/src/server/dev/get-source-map-from-file.ts:58

  const sourceUrl = getSourceMapUrl(fileContents)

  if (!sourceUrl) {
    return undefined
  }

  if (sourceUrl.startsWith('data:')) {
    let buffer: dataUriToBuffer.MimeBuffer

    try {
      buffer = dataUriToBuffer(sourceUrl)
    } catch (error) {
      throw new Error(`Failed to parse source map URL for ${filename}.`, {
        cause: error,
      })
    }

    if (buffer.type !== 'application/json') {
      throw new Error(
        `Unknown source map type for ${filename}: ${buffer.typeFull}.`
      )
    }

    try {
      return JSON.parse(buffer.toString())
    } catch (error) {
      throw new Error(`Failed to parse source map for ${filename}.`, {
        cause: error,
      })
    }
  }

  const sourceMapFilename = path.resolve(
    path.dirname(filename),
    decodeURIComponent(sourceUrl)
  )

View on GitHub (pinned to 0eb3775416)