{"record":{"id":"5e8d34ecb9aa8624","repo":"gohugoio/hugo","slug":"unsupported-sourcemap-type-q","errorCode":null,"errorMessage":"unsupported sourcemap type: %q","messagePattern":"unsupported sourcemap type: %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/esbuild/options.go","lineNumber":417,"sourceCode":"\tdefault:\n\t\terr = fmt.Errorf(\"unsupported drop type: %q\", opts.Drop)\n\t}\n\n\t// By default we only need to specify outDir and no outFile\n\toutDir := opts.OutDir\n\toutFile := \"\"\n\tvar sourceMap api.SourceMap\n\tswitch opts.SourceMap {\n\tcase \"inline\":\n\t\tsourceMap = api.SourceMapInline\n\tcase \"external\":\n\t\tsourceMap = api.SourceMapExternal\n\tcase \"linked\":\n\t\tsourceMap = api.SourceMapLinked\n\tcase \"\", \"none\":\n\t\tsourceMap = api.SourceMapNone\n\tdefault:\n\t\terr = fmt.Errorf(\"unsupported sourcemap type: %q\", opts.SourceMap)\n\t\treturn\n\t}\n\n\tsourcesContent := api.SourcesContentInclude\n\tif !opts.SourcesContent {\n\t\tsourcesContent = api.SourcesContentExclude\n\t}\n\n\tif opts.IsCSS && opts.MainFields == nil {\n\t\topts.MainFields = []string{\"style\", \"main\"}\n\t}\n\n\topts.Vars = sass.PrepareVars(opts.Vars)\n\n\topts.compiled = api.BuildOptions{\n\t\tOutfile:       outFile,\n\t\tBundle:        true,\n\t\tMetafile:      opts.Metafile,","sourceCodeStart":399,"sourceCodeEnd":435,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/internal/js/esbuild/options.go#L399-L435","documentation":"Thrown when SourceMap is not one of inline, external, linked, or none (empty string is also accepted and means none).","triggerScenarios":"Setting SourceMap to true, hidden, or any other string.","commonSituations":"User uses Webpack terminology (true, hidden); expects boolean values.","solutions":["Use: inline, external, linked, or none."],"exampleFix":"// before\n{{ $opts := dict \"sourceMap\" \"true\" }}\n\n// after\n{{ $opts := dict \"sourceMap\" \"inline\" }}","handlingStrategy":"validation","validationCode":"switch opts.SourceMap {\ncase \"\", \"inline\", \"external\", \"linked\", \"none\":\n    // ok\ndefault:\n    return fmt.Errorf(\"unsupported sourcemap type: %q\", opts.SourceMap)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate SourceMap against {inline, external, linked, none} before Build.","Reject boolean or Webpack-style values at config load."],"tags":["esbuild","options","sourcemap","validation"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}