@thead-vantage/react 2.10.0 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thead-vantage/react",
3
- "version": "2.10.0",
3
+ "version": "2.11.0",
4
4
  "description": "React components and utilities for TheAd Vantage ad platform integration",
5
5
  "main": "./src/index.ts",
6
6
  "module": "./src/index.ts",
@@ -83,7 +83,19 @@ export function AdBanner({
83
83
  }
84
84
  } catch (err) {
85
85
  console.error('[AdBanner] Error fetching ad:', err);
86
- setError(err instanceof Error ? err.message : 'Failed to fetch ad');
86
+
87
+ // For CORS errors, show user-friendly message but log technical details
88
+ if (err instanceof Error && err.message.includes('CORS error')) {
89
+ console.error('[AdBanner] CORS Error Details:', {
90
+ message: err.message,
91
+ note: 'This is a server-side configuration issue. The thead-vantage.com server needs to handle OPTIONS requests without redirecting. See CORS_CONFIGURATION.md for implementation details.',
92
+ });
93
+ // Show generic message to end users
94
+ setError('Ad unavailable');
95
+ } else {
96
+ // For other errors, show the error message
97
+ setError(err instanceof Error ? err.message : 'Failed to fetch ad');
98
+ }
87
99
  } finally {
88
100
  setLoading(false);
89
101
  }