{"record":{"id":"f83215e3f424d7f2","repo":"gohugoio/hugo","slug":"unsupported-platform-type-q","errorCode":null,"errorMessage":"unsupported platform type: %q","messagePattern":"unsupported platform type: %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/esbuild/options.go","lineNumber":383,"sourceCode":"\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 {\n\t\tdefines = hmaps.ToStringMapString(opts.Defines)\n\t}\n\n\tvar drop api.Drop\n\tswitch opts.Drop {\n\tcase \"\":\n\tcase \"console\":\n\t\tdrop = api.DropConsole\n\tcase \"debugger\":\n\t\tdrop = api.DropDebugger\n\tdefault:\n\t\terr = fmt.Errorf(\"unsupported drop type: %q\", opts.Drop)\n\t}","sourceCodeStart":365,"sourceCodeEnd":401,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/internal/js/esbuild/options.go#L365-L401","documentation":"Thrown when Platform is not browser (default), node, or neutral. These are the only platform values esbuild accepts.","triggerScenarios":"Setting Platform to web, deno, or any other string.","commonSituations":"User assumes web is the platform; tries deno; copy-paste from a bundler that uses different naming.","solutions":["Use: browser, node, or neutral."],"exampleFix":"// before\n{{ $opts := dict \"platform\" \"web\" }}\n\n// after\n{{ $opts := dict \"platform\" \"browser\" }}","handlingStrategy":"validation","validationCode":"switch opts.Platform {\ncase \"\", \"browser\", \"node\", \"neutral\":\n    // ok\ndefault:\n    return fmt.Errorf(\"unsupported platform type: %q\", opts.Platform)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate Platform against {browser, node, neutral} before Build.","Remember browser is the default; you can usually omit the option."],"tags":["esbuild","options","platform","validation"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}