ueberdosis/tiptap · error · Error

Failed to parse HTML string

Error message

Failed to parse HTML string

What it means

Error "Failed to parse HTML string" thrown in ueberdosis/tiptap.

Source

Thrown at packages/html/src/server/generateJSON.ts:54

      disableJavaScriptEvaluation: true,
      disableJavaScriptFileLoading: true,
      disableCSSFileLoading: true,
      disableIframePageLoading: true,
      disableComputedStyleRendering: true,
    },
  })
  const localDOMParser = new localWindow.DOMParser()
  let result: Record<string, any>

  try {
    const schema = getSchema(extensions)
    let doc: ReturnType<typeof localDOMParser.parseFromString> | null = null

    const htmlString = `<!DOCTYPE html><html><body>${html}</body></html>`
    doc = localDOMParser.parseFromString(htmlString, 'text/html')

    if (!doc) {
      throw new Error('Failed to parse HTML string')
    }

    result = PMDOMParser.fromSchema(schema)
      .parse(doc.body as unknown as Node, options)
      .toJSON()
  } finally {
    // clean up happy-dom to avoid memory leaks
    localWindow.happyDOM.abort()
    localWindow.happyDOM.close()
  }

  return result
}

View on GitHub (pinned to 496d53afd7)

When it happens

Trigger: Thrown at packages/html/src/server/generateJSON.ts:54 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of ueberdosis/tiptap@496d53afd7 (2026-08-26). Data as JSON: /api/errors/30e3d91a7b156f1c. Report an issue: GitHub.