{"record":{"id":"559cd535a6238bfe","repo":"gohugoio/hugo","slug":"webp-codec-is-not-available","errorCode":null,"errorMessage":"webp codec is not available","messagePattern":"webp codec is not available","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"resources/images/image.go","lineNumber":153,"sourceCode":"\t\treturn nil, err\n\t}\n\n\tm := cfg.Config.Imaging.Meta\n\tmetaDecoder, err := meta.NewDecoder(\n\t\tmeta.WithFields(m.Fields),\n\t\tmeta.WithSources(m.Sources...),\n\t\tmeta.WithWarnLogger(warnl),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\twebpCodec, err := wasmDispatchers.NewWepCodec()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif webpCodec == nil {\n\t\treturn nil, errors.New(\"webp codec is not available\")\n\t}\n\tavifCodec, err := wasmDispatchers.NewAvifCodec()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\timageCodec := newCodec(webpCodec, avifCodec, debugl)\n\n\treturn &ImageProcessor{\n\t\tCfg:         cfg,\n\t\texifDecoder: exifDecoder,\n\t\tmetaDecoder: metaDecoder,\n\t\tCodec:       imageCodec,\n\t}, nil\n}\n\ntype ImageProcessor struct {\n\tCfg         *config.ConfigNamespace[ImagingConfig, ImagingConfigInternal]\n\texifDecoder *meta.Decoder","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/resources/images/image.go#L135-L171","documentation":"`NewImageProcessor` initializes the WASM-backed WebP codec via `wasmDispatchers.NewWepCodec()`. If that returns a nil codec (no error but no implementation), image processing cannot function and startup fails at image.go:153. WebP encode/decode is core to Hugo's image pipeline.","triggerScenarios":"Hugo build startup when the embedded WASM WebP dispatcher cannot be instantiated and returns nil. This is a hard failure during `NewImageProcessor`, before any image is processed.","commonSituations":"Running a custom/trimmed Hugo build with the WebP WASM asset excluded; a corrupted or missing embedded WASM binary; platform/build constraints that disable the webp dispatcher; downgrading to a build predating the v0.153.0 WebP rework.","solutions":["Use an official Hugo release binary where the WebP WASM codec is embedded.","If building Hugo from source, ensure the WASM dispatcher assets are present and the build tags include the webp codec.","Re-download/reinstall Hugo to restore the embedded WASM binary if it was corrupted."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"proc, err := images.NewImageProcessor(...)\nif err != nil {\n    if strings.Contains(err.Error(), \"webp codec is not available\") {\n        // fall back to an official Hugo binary with embedded WASM codec\n    }\n    return err\n}","preventionTips":["Use official Hugo release binaries.","Keep embedded WASM assets intact when building from source.","Reinstall Hugo if the binary is corrupted."],"tags":["hugo","image-processing","webp","wasm","startup"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}