diff --git a/packages/editor/src/components/tools/tool-manager.tsx b/packages/editor/src/components/tools/tool-manager.tsx index 12f3fec2..05df8451 100644 --- a/packages/editor/src/components/tools/tool-manager.tsx +++ b/packages/editor/src/components/tools/tool-manager.tsx @@ -43,7 +43,12 @@ function getRegistryTool(tool: Tool | null): ComponentType | null { if (!def?.tool) return null const cached = lazyToolCache.get(def.tool) if (cached) return cached - const Comp = lazy(def.tool as () => Promise<{ default: ComponentType }>) + const Comp = lazy(async () => { + // A placed node is selected immediately. Resolve its custom inspector with + // the tool so that selection cannot introduce a second async boundary. + const [module] = await Promise.all([def.tool!(), def.parametrics?.customPanel?.()]) + return module as { default: ComponentType } + }) lazyToolCache.set(def.tool, Comp) return Comp }