Skip to content

Firebase CLI deploy of next.js app failed with error for missing file client-reference-manifest.js #6135

Closed

Description

@jdstanhope

[REQUIRED] Environment info

firebase-tools: 12.4.4

Platform: macOS 13.4.1 (c)

[REQUIRED] Test case

I have uploaded the project creating from the steps below to GitHub at jdstanhope/broken-thing

[REQUIRED] Steps to reproduce

Create a React app with using the next framework using the following selections

npx create-next-app

✔ What is your project named? … XXX
✔ Would you like to use TypeScript? … No / *Yes*
✔ Would you like to use ESLint? … No / *Yes*
✔ Would you like to use Tailwind CSS? … No / *Yes*
✔ Would you like to use `src/` directory? … No / *Yes*
✔ Would you like to use App Router? (recommended) … No / *Yes*
✔ Would you like to customize the default import alias? … *No* / Yes

Setup firebase hosting for the app

firebase init hosting

/path/to/home/directory/XXX

=== Project Setup

First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add,
but for now we'll just set up a default project.

? Please select an option: Create a new project
i  If you want to create a project in a Google Cloud organization or folder, please use "firebase projects:create" instead, and return to this command when you've created the project.
? Please specify a unique project id (warning: cannot be modified afterward) [6-30 characters]:
 XXX
? What would you like to call your project? (defaults to your project ID)
✔ Creating Google Cloud Platform project
✔ Adding Firebase resources to Google Cloud Platform project

🎉🎉🎉 Your Firebase project is ready! 🎉🎉🎉

Project information:
   - Project ID: XXX
   - Project Name: XXX

=== Hosting Setup
? Detected an existing Next.js codebase in the current directory, should we use this? Yes
? In which region would you like to host server-side content, if applicable? us-central1 (Iowa)
? Set up automatic builds and deploys with GitHub? No

i  Writing configuration info to firebase.json...
i  Writing project information to .firebaserc...

✔  Firebase initialization complete!

Deploy the app to firebase using

firebase deploy --only hosting

[REQUIRED] Expected behavior

App is deployed without an error.

[REQUIRED] Actual behavior

App deployment failed with an error in the firebase-debug.log with the following

[debug] [2023-07-16T18:13:25.722Z] Error: ENOENT: no such file or directory, open '/path/to/project/XXX/.next/server/client-reference-manifest.js'

Activity

  1. victorvierna commented on Jul 16, 2023

    @victorvierna

    Hi! I just encountered this same issue. Honestly, it's my first time deploying a Next.js app to Firebase Hosting, and I'm experiencing quite a few challenges. I'll probably open an Issue about this soon. I'm not entirely sure how I fixed it, but you could try the following steps:

    Lastly, check whether the problem arises when you access your website from Cloud Run (run.app) instead of from your custom domain (web.app). In my case, most of the issues only occur when using my custom domain (web.app), which might provide some clues for you.

  2. xSAVIKx commented on Jul 17, 2023

    @xSAVIKx

    I was debugging this issue yesterday as well. Eventually, I just downgraded all dependencies to match the Framework Tools (https://github.com/FirebaseExtended/firebase-framework-tools/blob/main/package.json)

  3. aalej commented on Jul 17, 2023

    @aalej
    Contributor

    Hi @jdstanhope, thanks for the detailed explanation of the issue you’re encountering! I was able to reproduce the error described when following the steps provided to reproduce the issue.

    I'll notify our team about this so that they can take a look and I’ll be marking this issue as reproducible.

  4. self-assigned this
    on Jul 17, 2023
  5. jdstanhope commented on Jul 17, 2023

    @jdstanhope
    Author

    I was able to fix the problem by downgrading from 13.4.10 to 13.4.7

  6. amit-meena commented on Jul 20, 2023

    @amit-meena

    downgrading to 13.4.9 worked for me

  7. thomchardon commented on Jul 27, 2023

    @thomchardon

    I encountered the same issue and was also able to deploy after downgrading to 13.4.7

  8. aldimenur commented on Aug 11, 2023

    @aldimenur

    works deploy after downgrading to 13.4.7 for me

  9. ritvij14 commented on Aug 11, 2023

    @ritvij14

    Downgrading to 13.4.7 worked for me too

    But @alexastrum, shouldn't this issue still be open? Downgrading is the only solution right now it seems, I use with latest 13.4.13 and faced the same issue

  10. marlier commented on Aug 16, 2023

    @marlier

    Installing current master of firebase-tools, this is fixed. (#6143 took care of it)

  11. alexastrum commented on Aug 16, 2023

    @alexastrum
    Contributor

    Great to hear!

  12. ktpeace commented on Feb 16, 2024

    @ktpeace

    @alexastrum I am experiencing this same issue with the following:

    "firebase-tools": "^13.3.0",
    "next": "^14.1.0",

    I had to downgrade Next to 13.4.7, which required downgrading Node from 20 to 18, in order to get rid of this error.

    This was with an entirely new project that was created with create-next-app and the instructions in https://firebase.google.com/docs/hosting/frameworks/nextjs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions