{"record":{"id":"03c9b3f68f1c1424","repo":"ueberdosis/tiptap","slug":"tiptap-warn-editor-state-was-read-while-decor","errorCode":null,"errorMessage":"[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.","messagePattern":"\\[tiptap warn\\]: `editor\\.state` was read while decoration `create\\(\\)` was running\\. It returns the pre-transaction document\\. Use the `state` argument passed to `create\\(\\)` instead\\. Helpers like `editor\\.isActive\\(\\)` read `editor\\.state` too, so pass `state` to their standalone versions instead of calling them on the editor\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/Editor.ts","lineNumber":382,"sourceCode":"          // We throw an error here, because we know the view is not available\n          throw new Error(\n            `[tiptap error]: The editor view is not available. Cannot access view['${key as string}']. The editor may not be mounted yet.`,\n          )\n        },\n      },\n    ) as EditorView\n  }\n\n  /**\n   * Returns the editor state.\n   */\n  public get state(): EditorState {\n    if (isDev && !this.hasWarnedStaleDecorationRead && isInDecorationApplyScope(this)) {\n      // Warn once per editor. The same read repeats on every transaction, and\n      // a decoration that dispatches from `create()` would flood the console.\n      this.hasWarnedStaleDecorationRead = true\n\n      console.warn(\n        '[tiptap warn]: `editor.state` was read while decoration `create()` was running. ' +\n          'It returns the pre-transaction document. Use the `state` argument passed to ' +\n          '`create()` instead. Helpers like `editor.isActive()` read `editor.state` too, ' +\n          'so pass `state` to their standalone versions instead of calling them on the editor.',\n      )\n    }\n\n    if (this.editorView) {\n      this.editorState = this.view.state\n    }\n\n    return this.editorState\n  }\n\n  /**\n   * Register a ProseMirror plugin.\n   *\n   * @param plugin A ProseMirror plugin","sourceCodeStart":364,"sourceCodeEnd":400,"githubUrl":"https://github.com/ueberdosis/tiptap/blob/496d53afd7e4e3c7424b4749adeff4f45e27ddb0/packages/core/src/Editor.ts#L364-L400","documentation":"Error \"[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.\" thrown in ueberdosis/tiptap.","triggerScenarios":"Thrown at packages/core/src/Editor.ts:382 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"}