{"record":{"id":"7ba850b2d584fa95","repo":"vercel/next.js","slug":"failed-to-parse-source-map-for-filename","errorCode":null,"errorMessage":"Failed to parse source map for ${filename}.","messagePattern":"Failed to parse source map for (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/next/src/server/dev/get-source-map-from-file.ts","lineNumber":66,"sourceCode":"\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  }\n\n  const sourceMapFilename = path.resolve(\n    path.dirname(filename),\n    decodeURIComponent(sourceUrl)\n  )\n\n  try {\n    const sourceMapContents = await fs.readFile(sourceMapFilename, 'utf-8')\n\n    return JSON.parse(sourceMapContents.toString())\n  } catch (error) {\n    throw new Error(`Failed to parse source map ${sourceMapFilename}.`, {\n      cause: error,\n    })","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/server/dev/get-source-map-from-file.ts#L48-L84","documentation":"Wrapper in getSourceMapFromFile: the inline data: URI source map decoded successfully but JSON.parse rejected its contents. The parse error is attached as cause; the artifact embeds syntactically invalid JSON as its source map.","triggerScenarios":"Parsing an inline or external source map fails.","commonSituations":"Corrupted source map data encountered while formatting dev error stacks.","solutions":["Ensure the referenced source map is valid JSON; regenerate it with the bundler."],"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"}