CORS blocking Web Messaging SDK in Next.js dev server

Getting blocked by CORS when initializing the Web Messaging SDK inside a Next.js application running on localhost:3000. The browser console throws Access to fetch at 'https://messaging.api.genesys.cloud...' from origin 'http://localhost:3000' has been blocked by CORS policy. I have set the allowed origins in the Genesys Cloud admin console but the widget still fails to load the config.

{
 "error": "NetworkError when attempting to fetch resource.",
 "url": "https://messaging.api.genesys.cloud/v1/messaging/config",
 "status": 0
}

The code looks fine. What is missing here.