{"record":{"id":"a83fc259979a1784","repo":"parcel-bundler/parcel","slug":"asset-does-not-have-a-source-map","errorCode":null,"errorMessage":"Asset does not have a source map","messagePattern":"Asset does not have a source map","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"info","filePath":"packages/reporters/dev-server/src/HMRServer.js","lineNumber":451,"sourceCode":"            frame.fileName = normalizeSeparators(\n              path.relative(this.options.projectRoot, location.filePath),\n            );\n          } else if (location.type === 'asset') {\n            // Get source map from the asset.\n            let contents = await location.asset.getCode();\n            frame.compiledLines = getCodeFrame(\n              frame.lineNumber,\n              frame.columnNumber,\n              contents,\n              json.contextLines,\n              location.asset.type,\n            );\n            frame.fileName = normalizeSeparators(\n              path.relative(this.options.projectRoot, location.asset.filePath),\n            );\n            map = await location.asset.getMap();\n            if (!map) {\n              throw new Error('Asset does not have a source map');\n            }\n          }\n\n          if (map && frame.lineNumber != null) {\n            // Find the original location in the source map.\n            let mapping = map.findClosestMapping(\n              frame.lineNumber,\n              frame.columnNumber,\n            );\n            if (mapping) {\n              let sourceFileName = mapping.source;\n              let source = sourceFileName\n                ? map.getSourceContent(sourceFileName) || ''\n                : '';\n              if (mapping.original && sourceFileName) {\n                frame.sourceLineNumber = mapping.original.line;\n                frame.sourceColumnNumber = mapping.original.column;\n                frame.sourceLines = getCodeFrame(","sourceCodeStart":433,"sourceCodeEnd":469,"githubUrl":"https://github.com/parcel-bundler/parcel/blob/59484858a1a0bcbb71f74088956bb437a2db6505/packages/reporters/dev-server/src/HMRServer.js#L433-L469","documentation":"Thrown by HMRServer while symbolication of a runtime stack frame points at an asset (location.type === 'asset'). The server asks the asset for its source map via getMap(); if the asset produced no map (e.g. source maps disabled, or the asset type never emits one), the symbolication for that single frame cannot proceed. Crucially, this throw sits inside a try/catch whose handler does `continue` (HMRServer.js:500-502), so the error is swallowed per-frame and only that frame's source mapping is skipped — it does not fail the request.","triggerScenarios":"A browser running against the Parcel dev server throws a JS error, the devtools requests /__parcel_hmr original-stack-frame for a frame whose location resolves to an asset, and that asset's getMap() returns null/undefined. Happens when source maps are off (asset.env.sourceMap === false) or for asset kinds that Parcel does not generate maps for.","commonSituations":"Building with `--no-source-maps`; production-style builds served through the dev server; assets transformed by a transformer that does not emit maps (some data/asset types); requesting stack frames after disabling source maps in .parcelrc or env config.","solutions":["Enable source maps for the dev target: remove `--no-source-maps`, set sourceMap: true in the target, or drop the target override.","Confirm the offending asset type has a transformer that emits source maps in your .parcelrc.","If you intentionally ship without source maps, ignore the dropped frame — the dev server still returns the other frames.","For prod builds replayed through the dev server, switch back to a development target."],"exampleFix":"// before: target disables source maps\n{\n  \"targets\": {\n    \"main\": {\n      \"sourceMap\": false,\n      \"context\": \"browser\",\n      \"mode\": \"development\"\n    }\n  }\n}\n// after: enable source maps for dev\n{\n  \"targets\": {\n    \"main\": {\n      \"sourceMap\": true,\n      \"context\": \"browser\",\n      \"mode\": \"development\"\n    }\n  }\n}","handlingStrategy":"validation","validationCode":"// In your dev server bootstrap, ensure source maps are on\nconst target = require('./.parcelrc.targets.json'); // your targets\nfor (const [name, t] of Object.entries(target)) {\n  if (t.sourceMap === false) {\n    console.warn(`[dev] target ${name} has sourceMap:false; stack frames will be dropped`);\n  }\n}","typeGuard":null,"tryCatchPattern":"// Already handled internally — HMRServer wraps this in try/catch continue.\n// No user action needed; the per-frame skip is by design.","preventionTips":["Always run `parcel serve` (dev mode) with source maps on.","Do not reuse production targets (which often disable source maps) for local development."],"tags":["hmr","dev-server","source-maps","symbolication","non-fatal"],"backgroundTag":null,"analyzedSha":"59484858a1a0bcbb71f74088956bb437a2db6505","analyzedAt":"2026-08-13T04:06:35.925Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}