{"record":{"id":"5099967117907091","repo":"toeverything/AFFiNE","slug":"could-not-find-block-with-id-id","errorCode":null,"errorMessage":"Could not find block with id ${id}","messagePattern":"Could not find block with id (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"blocksuite/framework/store/src/model/store/store.ts","lineNumber":656,"sourceCode":"\n    const blockModel =\n      typeof block === 'string' ? this.getBlock(block)?.model : block;\n    if (!blockModel) return null;\n\n    const index = parent.children.indexOf(blockModel);\n    if (index === -1) return null;\n\n    return fn(parent, index);\n  }\n\n  private _onBlockAdded(id: string, isLocal: boolean, init: boolean) {\n    try {\n      if (id in this._blocks.peek()) {\n        return;\n      }\n      const yBlock = this._yBlocks.get(id);\n      if (!yBlock) {\n        console.warn(`Could not find block with id ${id}`);\n        return;\n      }\n\n      const options: BlockOptions = {\n        onChange: (block, key, isLocal) => {\n          if (key) {\n            block.model.propsUpdated.next({ key });\n          }\n\n          this.slots.blockUpdated.next({\n            type: 'update',\n            id,\n            flavour: block.flavour,\n            props: { key },\n            isLocal,\n          });\n        },\n      };","sourceCodeStart":638,"sourceCodeEnd":674,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/blocksuite/framework/store/src/model/store/store.ts#L638-L674","documentation":"Warning logged in Store's `_onBlockAdded` when the yjs Y.Map `_yBlocks` contains no entry for the block id being added — the store was notified of a block (via subscription or init) that does not exist in the underlying yjs document, usually a race or out-of-sync update. The add is skipped; no block model is created for that id.","triggerScenarios":"Triggered when the store handles a block-added event for an id that has no corresponding YBlock in the underlying Yjs doc, so the block is not instantiated.","commonSituations":"Occurs with inconsistent or corrupted doc state, e.g. during sync races. Usually harmless; if blocks go missing, reload the doc to resync state.","solutions":["Verify the block id exists in the store before access.","The block may have been deleted; refresh the reference."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b4c8548c09da21b2898443559a5b846f0ccf5dd8","analyzedAt":"2026-08-18T21:16:52.546Z","contentChangedAt":"2026-08-18T21:16:52.546Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}