{"record":{"id":"f13374ae40085320","repo":"vercel/next.js","slug":"failed-to-parse-source-map-url-for-filename","errorCode":null,"errorMessage":"Failed to parse source map URL for ${filename}.","messagePattern":"Failed to parse source map URL for (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/next/src/server/dev/get-source-map-from-file.ts","lineNumber":52,"sourceCode":"  } catch (error) {\n    throw new Error(`Failed to read file contents of ${filename}.`, {\n      cause: error,\n    })\n  }\n\n  const sourceUrl = getSourceMapUrl(fileContents)\n\n  if (!sourceUrl) {\n    return undefined\n  }\n\n  if (sourceUrl.startsWith('data:')) {\n    let buffer: dataUriToBuffer.MimeBuffer\n\n    try {\n      buffer = dataUriToBuffer(sourceUrl)\n    } catch (error) {\n      throw new Error(`Failed to parse source map URL for ${filename}.`, {\n        cause: error,\n      })\n    }\n\n    if (buffer.type !== 'application/json') {\n      throw new Error(\n        `Unknown source map type for ${filename}: ${buffer.typeFull}.`\n      )\n    }\n\n    try {\n      return JSON.parse(buffer.toString())\n    } catch (error) {\n      throw new Error(`Failed to parse source map for ${filename}.`, {\n        cause: error,\n      })\n    }\n  }","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/server/dev/get-source-map-from-file.ts#L34-L70","documentation":"Wrapper in getSourceMapFromFile: the file's sourceMappingURL is a data: URI, but decoding it with dataUriToBuffer threw — the inline source map URL is malformed. The underlying decode error is chained as cause so the broken data URI can be diagnosed.","triggerScenarios":"The sourceMappingURL of a file cannot be parsed.","commonSituations":"A malformed source map URL comment in a compiled file.","solutions":["Fix the sourceMappingURL comment in the file to a valid data URL or path."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eb377541648e63402a47b38fee00a8d0ce8f8f1","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}