fix(editor-ui): RangeError when typing in Agent Instructions (multiple prosemirror-model instances)

在新版 Agent builder 的 Instructions 字段中输入任意字符时,编辑器会立即抛出 RangeError 并拒绝输入。核心报错为 fix(editor-ui): RangeError when typing in Agent Instructions (multiple pro

快速结论:在新版 Agent builder 的 Instructions 字段中输入任意字符时,编辑器会立即抛出 RangeError 并拒绝输入。核心报错为 fix(editor-ui): RangeError when typing in Agent Instructions (multiple prosemirror-model instances)。这属于打包层面的代码回归,优先确认是否为 2.43.7 这一版本的问题,并升级到 2.44.X+。

适用环境:n8n 2.43.7(Docker / Dokploy / compose,self-hosted,production);Node.js 26.7.0;PostgreSQL;浏览器为 Chrome / Chromium 内核;功能模块为 Agents & Assistant。

最快修复方案:Issue 中已确认升级到 2.44.X+ 可修复(维护者回复 “this issue is fixed in 2.44.X+”)。若暂时无法升级,可优先尝试回退到你最近一个可正常使用的 2.43.x 标签。

注意事项:该问题的根因在打包层面,Issue 讨论中也明确表示运行时配置或环境变量无法修复。回退版本属于临时绕过,不是正式修复;升级前建议先备份数据库与部署配置,并确认目标 2.44.X+ 版本与当前部署方式兼容。

问题场景

在 n8n 2.43.7 中进入 Agents → 新建或打开已有 Agent,在 Build 标签下的 Instructions 字段聚焦后输入任意字符,无论西里尔字母(如 ф)还是拉丁字母(如 w);编辑器会立即崩溃,控制台报 RangeError,输入无法写入。

报错原文

[tiptap warn]: Duplicate extension names found: ['link', 'underline']. This can lead to issues.
[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.
Uncaught RangeError: Can not convert <"w"> to a Fragment (looks like multiple versions of prosemirror-model were loaded)
    at e.from (vendor-BVB-Yazq.js:81:9886)
    at Zbt.handleDOMChange (vendor-BVB-Yazq.js:88:44975)

原因分析

根据 Issue 正文与讨论,根因是 editor-ui 打包时出现了多份 prosemirror-model(可能一份来自直接依赖,另一份来自 @tiptap/pm/model),同时 Tiptap 在该组件中重复注册了 link 与 underline 扩展。当输入触发 DOM 变更处理时,不同来源的 ProseMirror 实例不兼容,节点片段转换失败,从而抛出 RangeError。评论中进一步指出这是两个 @tiptap 包副本被打进同一个 bundle 的典型签名,属于代码回归,无法通过运行时配置规避。

环境排查

  • 确认 n8n 版本:报错集中于 2.43.7,优先核对是否处于该版本。
  • 确认部署方式:Docker / Dokploy / compose 自托管环境。
  • 确认浏览器:Chrome / Chromium 内核,查看开发者工具 Console 是否同时出现两条 tiptap warn。
  • 确认功能入口:Agents → Agent → Build → Instructions 字段。
  • Node.js 26.7.0、PostgreSQL 为 Issue 中的报告环境,不一定是触发条件。

解决步骤

  1. 在浏览器打开 Agent 的 Instructions 字段,输入一个字符,打开 Console 确认是否同时出现 Duplicate extension names found: ['link', 'underline'] 与 prosemirror-model is loaded more than once 两条警告,以确认命中同一问题。
  2. 该问题已被维护者确认在 2.44.X+ 修复;将 n8n 升级到 2.44.X+ 版本后重新验证。
  3. 若暂时无法升级,可优先尝试回退到最近一个在该环境下 Instructions 输入正常的 2.43.x 标签,作为临时绕过方案。
  4. 不要尝试通过 n8n 环境变量或运行时配置修复此问题,Issue 讨论已明确其属于打包层面的代码回归。

验证方法

升级或回退后重新进入 Agents → Agent → Build → Instructions,分别输入拉丁字符和西里尔字符,确认编辑器可正常接受输入,且 Console 不再出现上述两条 tiptap 警告与 RangeError。

参考来源

n8n-io/n8n #41318

GamsGo AI

AI 工具推荐

想把多个 AI 模型放在一个入口?

GamsGo AI 集成 ChatGPT、DeepSeek、Gemini、Claude、Midjourney、Veo 等常用模型,适合写作、绘图、视频和日常 AI 工作流。

了解 GamsGo AI

推广链接:通过此链接购买,我可能获得佣金,不影响你的价格。

这个方案解决了吗?

celebrityanime
celebrityanime
文章: 29425

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注