I am experiencing a persistent issue with the Web Preview feature in my Firebase Studio environment. When my Next.js development server is running, the Web Preview pane consistently fails to connect and displays the message: “Error reaching server”.
I have confirmed that the issue does not appear to be with my application code or its startup process. The development server starts successfully and logs that it is running and listening for requests. This leads me to believe the issue may be related to the internal networking or proxy layer within the Firebase Studio environment that connects the preview service to the running application container.
Environment & Configuration:
-
Framework: Next.js
-
Environment: Firebase Studio (Nix-based)
-
Configuration File:
.idx/dev.nix -
Startup Command:
npm run dev
Troubleshooting Steps Taken:
-
Verified Server Process: The
npm run devcommand completes successfully in the terminal, and the Next.js server logs indicate it is running and listening on the correct port assigned by the$PORTenvironment variable. -
Reviewed Configuration: My
.idx/dev.nixis configured to launch the web preview using the standard command for a Next.js application. Theidx.previewsconfiguration appears correct. -
No Application Errors: There are no crashes or network-related errors logged by my application itself. The server process remains stable while the Web Preview shows the connection error.
Given these points, the problem seems to be a connectivity issue between the Studio’s preview pane and the development server, rather than an error in the server itself. Could you please investigate if there are any known issues with the Web Preview’s internal proxy or networking layer for Nix-based environments?
Thank you for your help.