Skip to content

Cannot deploy Next.js app with Server Side Rendering #7146

@dominoFire

Description

@dominoFire

[REQUIRED] Environment info

firebase-tools:

PS C:\Users\ferag\one\two\three\four> firebase --version
13.8.1

Platform: Windows 11, node --version: v20.10.0

[REQUIRED] Test case

This happened when I was trying to deploy a next.js app, noted in https://github.com/copilotkit/copilotkit

[REQUIRED] Steps to reproduce

Create a next app with create-next-app

npx --yes create-next-app@14.2.3

Add a next.js backend route. Example: src/app/route.ts, like so:

export async function POST(req: Request): Promise<Response> {
    return new Response('Hello World', { status: 200 });
}

Init firebase Hosting in the created app

firebase init

Deploy the project

firebase deploy --debug

[REQUIRED] Expected behavior

My app is deployed to Firebase

[REQUIRED] Actual behavior

The deploy fails with the following message:


Building a Cloud Function to run this application. This is needed due to:
 • Image Optimization
 • non-static component /api/route

[2024-05-09T18:25:24.695Z] >>> [apiv2][query] GET https://firebasehosting.googleapis.com/v1beta1/projects/propio-panel/sites/propio-panel [none]
[2024-05-09T18:25:25.324Z] <<< [apiv2][status] GET https://firebasehosting.googleapis.com/v1beta1/projects/propio-panel/sites/propio-panel 200
[2024-05-09T18:25:25.325Z] <<< [apiv2][body] GET https://firebasehosting.googleapis.com/v1beta1/projects/propio-panel/sites/propio-panel {"name":"projects/propio-panel/sites/propio-panel","defaultUrl":"https://propio-panel.web.app","type":"DEFAULT_SITE"}
[2024-05-09T18:25:25.427Z] Error: ENOENT: no such file or directory, lstat 'C:\Users\ferag\one\two\three\four\hosting\.next\C:\Users\ferag\one\two\three\four\hosting\.next\app-build-manifest.json'

Error: An unexpected error has occurred.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions