ueberdosis/tiptap · error

[tiptap error]: The editor cannot be mounted because there i

Error message

[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.

What it means

Error "[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment." thrown in ueberdosis/tiptap.

Source

Thrown at packages/core/src/Editor.ts:175

        doc: initialDoc,
        schema: this.schema,
        selection: selection || undefined,
      })
    }

    warnOnDuplicatedProseMirrorModel(this.schema)

    if (this.options.element) {
      this.mount(this.options.element)
    }
  }

  /**
   * Attach the editor to the DOM, creating a new editor view.
   */
  public mount(el: NonNullable<EditorOptions['element']> & {}) {
    if (typeof document === 'undefined') {
      throw new Error(
        `[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.`,
      )
    }
    this.createView(el)
    this.emit('mount', { editor: this })

    if (this.css && !document.head.contains(this.css)) {
      document.head.appendChild(this.css)
    }

    window.setTimeout(() => {
      if (this.isDestroyed) {
        return
      }

      if (this.options.autofocus !== false && this.options.autofocus !== null) {
        this.commands.focus(this.options.autofocus)
      }

View on GitHub (pinned to 496d53afd7)

When it happens

Trigger: Thrown at packages/core/src/Editor.ts:175 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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