docs/plans/4527-ai-menu-streaming-anchor-undefined.md
#4527AIMenu: Cannot read properties of undefined (reading '0') during streaminghttps://github.com/udecode/plate/issues/4527main can still dereference an undefined AI chat anchor during streaming; if yes, fix it and verify the AI menu remains stable during streaming startupAIMenuapps/www/src/registry/ui/ai-menu.tsxpackages/ai/src/react/ai-chat/AIChatPlugin.tspackages/ai/src/react/ai-chat/streaming/streamInsertChunk.tsapps/www or packages/ai49.0.2, so it may be stalemain still contains the exact anchor![0] dereference inside the streaming effect in AIMenu#4527 is currently open or merged by title/body searchmain.AIMenu.AIMenu implementation still uses const anchorDom = editor.api.toDOMNode(anchor![0])! inside a setTimeout.apps/www/src/registry/ui/ai-menu.spec.tsx that reproduced the current undefined-anchor crash on main.apps/www/src/registry/ui/ai-menu.tsx to resolve the anchor inside the timeout, guard missing anchor entries, and clear the timeout on cleanup.pnpm --filter www build, pnpm --filter www typecheck, pnpm lint:fix, and full pnpm check./blocks/editor-ai surface in the real browser and captured proof at .claude/tmp/4527-ai-menu-browser-proof.png.planning-with-files session catchup script path from the generated skill is missing locally, so catchup could not run in this repo.browser-use screenshot writes only accept repo-relative paths, not absolute paths.