Hello,
I’m running a Next.js application within a managed development environment (Firebase Studio, which uses Google Cloud Workstations) and I’m stuck in a loop with a cross-origin error. The Next.js dev server starts, but the browser is unable to load Next.js resources (like scripts and HMR) because the requests are being blocked.
The error in the server logs is consistently: Error: ⚠ Blocked cross-origin request from <URL> to /_next/* resource. To allow this, configure "allowedDevOrigins" in next.config
The URL in the error message is dynamic, often looking something like 6000-firebase-studio-....cloudworkstations.dev or 9000-firebase-studio-....cloudworkstations.dev.
What I’ve tried:
I have repeatedly modified my next.config.ts to include these URLs in the allowedDevOrigins array. Here is my current next.config.ts:
import type {NextConfig} from 'next';
const nextConfig: NextConfig = {
/* config options here */
typescript: {
ignoreBuildErrors: true,
},
eslint: {
ignoreDuringBuilds: true,
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'placehold.co',
port: '',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'images.unsplash.com',
port: '',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'picsum.photos',
},
],
},
allowedDevOrigins: [
'https://*.cluster-hllxpfasbba62ri4b2ygaupuxu.cloudworkstations.dev',
'https://6000-firebase-studio-1759340049650.cluster-hllxpfasbba62ri4b2ygaupuxu.cloudworkstations.dev',
'https://9000-firebase-studio-1759340049650.cluster-hllxpfasbba62ri4b2ygaupuxu.cloudworkstations.dev',
'https://9002-firebase-studio-1759340049650.cluster-hllxpfasbba62ri4b2ygaupuxu.cloudworkstations.dev',
],
};
export default nextConfig;
Despite adding a wildcard ('https://*.cluster-hllxpfasbba62ri4b2ygaupuxu.cloudworkstations.dev') and specific URLs from the logs, the issue persists after every server restart. It feels like the configuration is not being respected or is being overwritten.
Environment Details:
-
Next.js version: 15.3.3
-
Dev command:
next dev --turbopack -p 9002 -
Environment: Firebase Studio / Google Cloud Workstations (containerized, proxied)
Has anyone encountered this in a similar proxied or containerized dev environment? Is there a known issue with allowedDevOrigins and Turbopack, or a different configuration required for this kind of setup?