Skip to content

Fix pnpm dependency resolution causing plugin load failure#819

Draft
Copilot wants to merge 3 commits intov3from
copilot/fix-chatgpt-plugin-error
Draft

Fix pnpm dependency resolution causing plugin load failure#819
Copilot wants to merge 3 commits intov3from
copilot/fix-chatgpt-plugin-error

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 22, 2025

Plugin fails to load in Trss-Yunzai 3.0 with TypeError: Cannot read properties of undefined (reading 'prototype') due to pnpm's strict dependency isolation preventing chaite's bundled code from resolving Node.js built-in modules.

Changes

  • .npmrc: Add shamefully-hoist=true to hoist dependencies to root, matching npm behavior
  • package.json: Configure pnpm.peerDependencyRules.ignoreMissing for sqlite3 (installed at Yunzai level)

The empty "pnpm": {} object provided no hoisting configuration, causing pnpm to isolate dependencies in a way that broke module resolution for bundled code.

Original prompt

This section details on the original issue you should resolve

<issue_title>[启动遇到错误]从3.0.0beta更新到正式版3.0,trss和chatgpt-plugin插件都pull到了最新</issue_title>
<issue_description>Image

  • 其中chatgpt-plugin插件进行重新clone和pull都一样出现插件加载错误 chatgpt-plugin TypeError: Cannot read properties of undefined (reading 'prototype'),甚至以为是trss太旧没更新环境的问题,也重新git pull了一次trss也依然这样,实在没办法来求助</issue_description>

<agent_instructions>能看看这个错事什么依赖导致的吗 copilot老哥</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@ikechan8370 那你先暂时降级用 可能是哪个依赖版本问题。我现在复现不出。 有空我换几个环境测一测

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits November 22, 2025 04:35
Co-authored-by: ikechan8370 <21212372+ikechan8370@users.noreply.github.com>
- Add shamefully-hoist=true to .npmrc for proper dependency hoisting
- Configure pnpm peerDependencyRules to ignore missing sqlite3
- Fixes "Cannot read properties of undefined (reading 'prototype')" error
- This ensures chaite's bundled dependencies work correctly with pnpm

Co-authored-by: ikechan8370 <21212372+ikechan8370@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix plugin loading error for chatgpt-plugin Fix pnpm dependency resolution causing plugin load failure Nov 22, 2025
Copilot AI requested a review from ikechan8370 November 22, 2025 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[启动遇到错误]从3.0.0beta更新到正式版3.0,trss和chatgpt-plugin插件都pull到了最新

2 participants