Skip to content

Conversation

@ryanbonial
Copy link
Member

@ryanbonial ryanbonial commented Sep 16, 2025

Description

Added CORS error handling to improve the developer experience when encountering cross-origin resource sharing issues. This implementation detects CORS errors from the query store, extracts the project ID from error messages, and displays a helpful error component with instructions on how to add the current origin to the project's CORS configuration.
Before
CleanShot 2025-09-16 at 09 25 46@2x

After
CleanShot 2025-09-15 at 21 17 05@2x

What to review

  • New CorsError component that displays helpful guidance
  • Error handling in the query store to catch CORS errors
  • Integration with AuthBoundary to show CORS errors
  • New utility functions for extracting project IDs from CORS errors
  • New hooks and exports to support this functionality

Testing

Tested by simulating CORS errors and verifying that the error component displays correctly with the appropriate project ID and origin information.

Fun gif

fix

@vercel
Copy link

vercel bot commented Sep 16, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
sdk-docs Ready Ready Preview Comment Sep 17, 2025 6:11pm
sdk-kitchensink-react Ready Ready Preview Comment Sep 17, 2025 6:11pm

Copy link
Member

@cngonzalez cngonzalez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me at a high level. Tested it locally because I was a little curious about any side effect of using defer but things looked reasonable to me.

@ryanbonial ryanbonial merged commit 7610ec2 into main Sep 18, 2025
22 of 23 checks passed
@ryanbonial ryanbonial deleted the rb/cors-add-link branch September 18, 2025 16:54
@squiggler squiggler bot mentioned this pull request Sep 18, 2025
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.

2 participants