run-llama/llama_index · error · ValueError

Unknown document type: {type(document)}

Error message

Unknown document type: {type(document)}

What it means

Error "Unknown document type: {type(document)}" thrown in run-llama/llama_index.

Source

Thrown at llama-index-core/llama_index/core/node_parser/node_utils.py:88

                text_template=document.text_template,
                relationships=relationships,
            )
            nodes.append(node)
        elif isinstance(document, TextNode):
            node = TextNode(
                id_=id_func(i, document),
                text=text_chunk,
                embedding=document.embedding,
                excluded_embed_metadata_keys=document.excluded_embed_metadata_keys,
                excluded_llm_metadata_keys=document.excluded_llm_metadata_keys,
                metadata_seperator=document.metadata_separator,
                metadata_template=document.metadata_template,
                text_template=document.text_template,
                relationships=relationships,
            )
            nodes.append(node)
        else:
            raise ValueError(f"Unknown document type: {type(document)}")

    return nodes

View on GitHub (pinned to afd0fef371)

Solutions

  1. Pass a Document or BaseNode instance.
  2. Convert the input into a Document before building nodes from it.

When it happens

Trigger: Thrown at llama-index-core/llama_index/core/node_parser/node_utils.py:88 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of run-llama/llama_index@afd0fef371 (2026-08-15). Data as JSON: /api/errors/78cabfdd6d6ed4c3. Report an issue: GitHub.