{"record":{"id":"50f158675bf06a23","repo":"projectdiscovery/katana","slug":"could-not-normalize-dom","errorCode":null,"errorMessage":"could not normalize dom","messagePattern":"could not normalize dom","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/engine/headless/crawler/state.go","lineNumber":113,"sourceCode":"func getStrippedDOM(contents string) (string, error) {\n\tnormalized, err := domNormalizer.Apply(contents)\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"could not normalize dom\")\n\t}\n\treturn normalized, nil\n}","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/projectdiscovery/katana/blob/e3e742739c3746f085943ce918fb4e2b8daf6fe6/pkg/engine/headless/crawler/state.go#L95-L131","documentation":"getStrippedDOM throws when domNormalizer.Apply cannot normalize the given HTML contents. It is a thin validation/transform helper over the normalizer; the faulting input is the page's outer HTML string, which presumably failed parsing or normalization rules.","triggerScenarios":"Thrown at pkg/engine/headless/crawler/state.go:113 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped normalizer error for the specific parsing failure","Validate/sanitize the HTML string before passing it to domNormalizer.Apply","Return the original contents unnormalized as a degraded-mode fallback","Report the failing page so the normalizer rules can be extended to cover it"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e3e742739c3746f085943ce918fb4e2b8daf6fe6","analyzedAt":"2026-09-03T14:55:13.248Z","contentChangedAt":"2026-09-03T14:55:13.248Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}