{"record":{"id":"5d6694cf49596cf5","repo":"ueberdosis/tiptap","slug":"tiptap-error-the-editor-cannot-be-mounted-becau","errorCode":null,"errorMessage":"[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.","messagePattern":"\\[tiptap error\\]: The editor cannot be mounted because there is no 'document' defined in this environment\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/Editor.ts","lineNumber":175,"sourceCode":"        doc: initialDoc,\n        schema: this.schema,\n        selection: selection || undefined,\n      })\n    }\n\n    warnOnDuplicatedProseMirrorModel(this.schema)\n\n    if (this.options.element) {\n      this.mount(this.options.element)\n    }\n  }\n\n  /**\n   * Attach the editor to the DOM, creating a new editor view.\n   */\n  public mount(el: NonNullable<EditorOptions['element']> & {}) {\n    if (typeof document === 'undefined') {\n      throw new Error(\n        `[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.`,\n      )\n    }\n    this.createView(el)\n    this.emit('mount', { editor: this })\n\n    if (this.css && !document.head.contains(this.css)) {\n      document.head.appendChild(this.css)\n    }\n\n    window.setTimeout(() => {\n      if (this.isDestroyed) {\n        return\n      }\n\n      if (this.options.autofocus !== false && this.options.autofocus !== null) {\n        this.commands.focus(this.options.autofocus)\n      }","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/ueberdosis/tiptap/blob/496d53afd7e4e3c7424b4749adeff4f45e27ddb0/packages/core/src/Editor.ts#L157-L193","documentation":"Error \"[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.\" thrown in ueberdosis/tiptap.","triggerScenarios":"Thrown at packages/core/src/Editor.ts:175 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"496d53afd7e4e3c7424b4749adeff4f45e27ddb0","analyzedAt":"2026-08-26T22:41:43.400Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}