
Failed To compile
快速结论:该报错在 LobeChat v2.2.9 部署编译时触发,原因是 @lobehub/editor 依赖版本不匹配,新版移除了 FloatMenu 导出。优先排查 @lobehub/editor 的锁定版本。
问题场景
用户在 macOS 系统上通过 Zeabur 平台部署 LobeChat v2.2.9,执行 Docker 镜像构建时编译失败。浏览器为 Chrome,客户端类型为 Web (Desktop Browser)。
报错原文
INFO 🛠️ building image | #20 24.73 ╭─[ src/features/ChatInput/InputEditor/index.tsx:7:18 ]
INFO 🛠️ building image | #20 24.73 7 │ import { Editor, FloatMenu, useEditorState } from "@lobehub/editor/react";
INFO 🛠️ building image | #20 24.73 │ ────┬────
INFO 🛠️ building image | #20 24.73 │ ╰────── Missing export
ERROR INFO 🛠️ building image | #20 24.92 ELIFECYCLE Command failed with exit code 1.
ERROR INFO 🛠️ building image | #20 24.94 ELIFECYCLE Command failed with exit code 1.
原因分析
这是一个已知的依赖版本不匹配问题。在 LobeChat v2.2.9 中,src/features/ChatInput/InputEditor/index.tsx 仍然导入 FloatMenu,但 @lobehub/editor 的新版本(由 caret 范围 ^4.18.1 解析到的更高版本)已移除了 FloatMenu 的导出,导致编译时出现 “Missing export” 错误。
环境排查
- LobeChat 版本:v2.2.9
- 部署平台:Zeabur(Docker 构建)
- 构建工具链:Vite + Rolldown
- 相关依赖:
@lobehub/editor(版本范围^4.18.1) - 操作系统:macOS
解决步骤
- 确认是否为已知问题:该问题已在 PR #16566 和 PR #16438 中讨论,属于重构后引入的版本匹配问题。
- 可优先尝试:锁定
@lobehub/editor到一个已知兼容的精确版本(例如4.18.0),在项目的package.json中找到对应依赖项,将其版本从^4.18.1改为4.18.0。 - 删除
node_modules和pnpm-lock.yaml(或package-lock.json/yarn.lock),重新执行安装和构建流程。 - 如果使用 Docker 构建,确保清除构建缓存后重新构建镜像。
验证方法
重新执行构建命令,观察编译过程不再出现 Missing export 错误,且构建成功退出码为 0,即可确认问题已解决。


