{"record":{"id":"30a2c5bba47f1007","repo":"gohugoio/hugo","slug":"failed-to-create-page-from-pagemetasource-s-w","errorCode":null,"errorMessage":"failed to create page from pageMetaSource %s: %w","messagePattern":"failed to create page from pageMetaSource (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hugolib/content_map_page_assembler.go","lineNumber":357,"sourceCode":"\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\tpanic(fmt.Sprintf(\"unexpected type %T\", v))\n\t\t\t}\n\n\t\t\treturn\n\t\t}\n\n\t\t// The common case.\n\t\tns = doctree.NodeTransformStateReplaced\n\n\t\thandleContentNodeSeq := func(v contentNodeSeq) (contentNode, doctree.NodeTransformState, error) {\n\t\t\tis := make(contentNodesMap)\n\t\t\tfor ms := range v {\n\t\t\t\t_, err := handlePageMetaSource(ms, is, false)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, 0, fmt.Errorf(\"failed to create page from pageMetaSource %s: %w\", s, err)\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn is, ns, nil\n\t\t}\n\n\t\tswitch v := n.(type) {\n\t\tcase contentNodeSeq, contentNodes:\n\t\t\treturn handleContentNodeSeq(cnh.contentNodeToSeq(v))\n\t\tcase *pageMetaSource:\n\t\t\tn2, err = handlePageMetaSource(v, nil, false)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, 0, fmt.Errorf(\"failed to create page from pageMetaSource %s: %w\", s, err)\n\t\t\t}\n\t\t\treturn\n\t\tcase *pageState:\n\t\t\t// Nothing to do.\n\t\t\tns = doctree.NodeTransformStateNone\n\t\t\treturn v, ns, nil","sourceCodeStart":339,"sourceCodeEnd":375,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/hugolib/content_map_page_assembler.go#L339-L375","documentation":"Returned inside transformPages' handleContentNodeSeq when handlePageMetaSource fails for one pageMetaSource in a contentNodeSeq (a sequence of page sources for the same path, e.g. multi-language or multi-version). The path key s is included. This is the multi-source branch where each source in the sequence is turned into a concrete page node.","triggerScenarios":"During the page-assembly transform pass, one of several pageMetaSource objects sharing a tree key fails to resolve into a pageState — front matter invalid, path info bad, site vector conflict, or page-config compilation error. Common with multilingual/multi-version content where one language/version is broken.","commonSituations":"One translation in a multilingual bundle has invalid front matter; a content adapter produces a bad PageConfigEarly for one variant; version (e.g. draft/published) specific config error; sitesmatrix vector conflict between bundled sources.","solutions":["Unwrap the %w to find which source and which cause failed; the path key s identifies the tree location.","Inspect every pageMetaSource variant at that path (all languages/versions) for front-matter or config issues.","For content-adapter-generated sources, validate PageConfigEarly before emission.","Isolate by building a single language/version at a time to find the failing variant."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"func validateAllVariants(sources []*pageMetaSource) error {\n    for _, s := range sources {\n        if err := s.pageConfigSource.CompileForPagesFromDataPre(base, log, mediaTypes); err != nil { return err }\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"if _, _, err := transformPages(s, n, getCascades(...)); err != nil {\n    if strings.Contains(err.Error(), \"failed to create page from pageMetaSource\") {\n        // build one language/version at a time to isolate the failing variant\n    }\n}","preventionTips":["Validate every language/version variant's front matter.","For content adapters, compile PageConfigEarly before emitting sources.","Isolate multilingual failures by building per-language."],"tags":["page","multilingual","transform","content-map","hugolib"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}