Skip to content

fix: resolve graceful-fs cyclic __proto__ value error in Rolldown #258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: rolldown-vite
Choose a base branch
from

Conversation

1600822305
Copy link

  • Add gracefulFsCompatPlugin to detect and fix Object.setPrototypeOf cycles
  • Transform problematic graceful-fs patterns that cause 'Cyclic proto value' errors
  • Add cycle detection to prevent infinite prototype chains
  • Integrate plugin into Vite build pipeline for automatic fixing

Fixes compatibility issues when bundling graceful-fs with Rolldown bundler.

Description

- Add gracefulFsCompatPlugin to detect and fix Object.setPrototypeOf cycles
- Transform problematic graceful-fs patterns that cause 'Cyclic __proto__ value' errors
- Add cycle detection to prevent infinite prototype chains
- Integrate plugin into Vite build pipeline for automatic fixing

Fixes compatibility issues when bundling graceful-fs with Rolldown bundler.
@TheAlexLichter
Copy link
Collaborator

Thanks for the PR - but did you report the issue with graceful-fs somewhere (ideally here or if reproducible just with rolldown there)? This should be fixed instead of having a plugin workaround 😋

@1600822305 1600822305 marked this pull request as draft June 16, 2025 00:59
@1600822305 1600822305 marked this pull request as ready for review June 17, 2025 05:16
@1600822305
Copy link
Author

感谢您的 PR - 但您是否在某处报告了 graceful-fs 的问题(理想情况下在这里,或者如果可以重现,只是在那里向下滚动)?这应该被修复,而不是有插件解决方法 😋

Thanks for the feedback! I haven't reported this issue yet. Let me clarify:

This issue occurs when building Electron applications with rolldown-vite. I can reproduce it consistently in the Cherry Studio project when using graceful-fs.

Should I:

  1. Create an issue here in rolldown-vite with the reproduction case?
  2. Or test if this happens with pure rolldown and report it there?

I'd be happy to create a minimal reproduction case to help identify where exactly the problem lies.

@sapphi-red
Copy link
Member

Yes, please create an issue here with a reproduction. If you're able to reduce it to a minimal case that only involves Rolldown, it would be great if you could also open an issue in the Rolldown repo and link back to that one.

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 participants