fix(rpc): override mainnet RPC to resolve CORS errors on eth.merkle.io#176
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe frontend now defines a local Mainnet chain object in ChangesMainnet RPC override
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
c047352 to
a4e1445
Compare
Addressed Issues:
Fixes #170
Screenshots/Recordings:
Before:
The browser console was cluttered with persistent CORS errors when the application attempted to connect to Mainnet via Wagmi's default RPC endpoint (
eth.merkle.io).After:
The console is now clean on initial load, and Wagmi connects successfully to the Mainnet network without failing preflight requests or throwing
ERR_FAILEDlogs.Additional Notes:
eth.merkle.io) actively blocks requests originating from our domain (https://chainvoice.stability.nexus) by omitting the requiredAccess-Control-Allow-Originheader, which caused the browser's CORS policy to block the fetch requests.mainnetconfiguration insrc/App.jsxto prepend a reliable, CORS-friendly public RPC (https://cloudflare-eth.com) to the list ofrpcUrls.AI Usage Disclosure:
We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact. AI slop is strongly discouraged and may lead to banning and blocking. Do not spam our repos with AI slop.
Check one of the checkboxes below:
I have used the following AI models and tools: TODO
Checklist
Summary by CodeRabbit