{"record":{"id":"035bc5eb8d062d3d","repo":"gohugoio/hugo","slug":"unsupported-jsx-type-q","errorCode":null,"errorMessage":"unsupported jsx type: %q","messagePattern":"unsupported jsx type: %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/esbuild/options.go","lineNumber":370,"sourceCode":"\tcase \"esm\":\n\t\tformat = api.FormatESModule\n\tcase \"cjs\":\n\t\tformat = api.FormatCommonJS\n\tdefault:\n\t\terr = fmt.Errorf(\"unsupported script output format: %q\", opts.Format)\n\t\treturn\n\t}\n\n\tvar jsx api.JSX\n\tswitch opts.JSX {\n\tcase \"\", \"transform\":\n\t\tjsx = api.JSXTransform\n\tcase \"preserve\":\n\t\tjsx = api.JSXPreserve\n\tcase \"automatic\":\n\t\tjsx = api.JSXAutomatic\n\tdefault:\n\t\terr = fmt.Errorf(\"unsupported jsx type: %q\", opts.JSX)\n\t\treturn\n\t}\n\n\tvar platform api.Platform\n\tswitch opts.Platform {\n\tcase \"\", \"browser\":\n\t\tplatform = api.PlatformBrowser\n\tcase \"node\":\n\t\tplatform = api.PlatformNode\n\tcase \"neutral\":\n\t\tplatform = api.PlatformNeutral\n\tdefault:\n\t\terr = fmt.Errorf(\"unsupported platform type: %q\", opts.Platform)\n\t\treturn\n\t}\n\n\tvar defines map[string]string\n\tif opts.Defines != nil {","sourceCodeStart":352,"sourceCodeEnd":388,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/internal/js/esbuild/options.go#L352-L388","documentation":"Thrown when the JSX option is not one of transform (default), preserve, or automatic. These map directly to esbuild's api.JSX values.","triggerScenarios":"Setting JSX to classic, react, or any other string.","commonSituations":"User assumes classic React behavior or uses Babel/TypeScript terminology like classic or react.","solutions":["Use: transform (default), preserve, or automatic.","If using automatic, also set JSXImportSource (e.g. react)."],"exampleFix":"// before\n{{ $opts := dict \"jsx\" \"classic\" }}\n\n// after\n{{ $opts := dict \"jsx\" \"automatic\" \"jsxImportSource\" \"react\" }}","handlingStrategy":"validation","validationCode":"switch opts.JSX {\ncase \"\", \"transform\", \"preserve\", \"automatic\":\n    // ok\ndefault:\n    return fmt.Errorf(\"unsupported jsx type: %q\", opts.JSX)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate JSX against {transform, preserve, automatic} before Build.","When using automatic, also set JSXImportSource."],"tags":["esbuild","options","jsx","validation"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}