Version of @opentiny/next-sdk (and @opentiny/next-remoter if applicable)
0.2.9
Node.js Version
22.21.1
Link to minimal reproduction
@opentiny/next-remoter@0.2.9 中 tiny-robot@0.3.1-alpha.6 导致打包失败 - 无法解析 @tiptap 包
❌ 打包失败,输出以下错误信息:
[commonjs--resolver] Failed to resolve entry for package "@tiptap/vue-3". The package may have incorrect main/module/exports specified in its package.json.
[commonjs--resolver] Failed to resolve entry for package "@tiptap/extension-document".
[commonjs--resolver] Failed to resolve entry for package "@tiptap/extension-paragraph".
[commonjs--resolver] Failed to resolve entry for package "@tiptap/extension-text".
[commonjs--resolver] Failed to resolve entry for package "@tiptap/extension-history".
[commonjs--resolver] Failed to resolve entry for package "@tiptap/extension-placeholder".
[commonjs--resolver] Failed to resolve entry for package "@tiptap/extension-character-count".
[commonjs--resolver] Failed to resolve entry for package "@tiptap/pm".
[commonjs--resolver] Failed to resolve entry for package "@tiptap/core".
问题描述
1、硬编码依赖:@opentiny/next-remoter@0.2.9 在其 package.json 中硬编码依赖 @opentiny/tiny-robot@0.3.1-alpha.6,这是一个 alpha 版本
2、构建产物导入问题:tiny-robot@0.3.1-alpha.6 的编译产物(dist/chat-input/index.js)中直接导入了 @tiptap 相关的包
3、PeerDependencies 配置不匹配:
- tiny-robot 将 @tiptap 包声明为 peerDependencies(表示可选)
- 但在运行时直接导入这些包,导致内部矛盾
- 当项目中没有安装这些 @tiptap 包时,导入失败
4、构建时解析失败:Rollup/esbuild 在编译时尝试解析这些不存在的 @tiptap 导入时,无法找到对应的包,导致构建失败
Step to reproduce
安装最新npm包
npm install @opentiny/next-remoter@0.2.9 @opentiny/next-sdk@0.2.9
运行dev
npm run dev
版本链:
- @opentiny/next-remoter: 0.2.9
- @opentiny/next-sdk: 0.2.9
- @opentiny/tiny-robot: 0.3.1-alpha.6(通过依赖引入)
- Vite: 5.2.8
- Vue: 3.4.21
What is expected
No response
What is actually happening
No response
What is your project name
fnova
Any additional comments (optional)
No response
Version of @opentiny/next-sdk (and @opentiny/next-remoter if applicable)
0.2.9
Node.js Version
22.21.1
Link to minimal reproduction
@opentiny/next-remoter@0.2.9 中 tiny-robot@0.3.1-alpha.6 导致打包失败 - 无法解析 @tiptap 包
❌ 打包失败,输出以下错误信息:
[commonjs--resolver] Failed to resolve entry for package "@tiptap/vue-3". The package may have incorrect main/module/exports specified in its package.json.
[commonjs--resolver] Failed to resolve entry for package "@tiptap/extension-document".
[commonjs--resolver] Failed to resolve entry for package "@tiptap/extension-paragraph".
[commonjs--resolver] Failed to resolve entry for package "@tiptap/extension-text".
[commonjs--resolver] Failed to resolve entry for package "@tiptap/extension-history".
[commonjs--resolver] Failed to resolve entry for package "@tiptap/extension-placeholder".
[commonjs--resolver] Failed to resolve entry for package "@tiptap/extension-character-count".
[commonjs--resolver] Failed to resolve entry for package "@tiptap/pm".
[commonjs--resolver] Failed to resolve entry for package "@tiptap/core".
问题描述
1、硬编码依赖:@opentiny/next-remoter@0.2.9 在其 package.json 中硬编码依赖 @opentiny/tiny-robot@0.3.1-alpha.6,这是一个 alpha 版本
2、构建产物导入问题:tiny-robot@0.3.1-alpha.6 的编译产物(dist/chat-input/index.js)中直接导入了 @tiptap 相关的包
3、PeerDependencies 配置不匹配:
4、构建时解析失败:Rollup/esbuild 在编译时尝试解析这些不存在的 @tiptap 导入时,无法找到对应的包,导致构建失败
Step to reproduce
安装最新npm包
npm install @opentiny/next-remoter@0.2.9 @opentiny/next-sdk@0.2.9运行dev
npm run dev版本链:
What is expected
No response
What is actually happening
No response
What is your project name
fnova
Any additional comments (optional)
No response