Skip to content

App Hosting Emulator crashes on firebase-tools v14.4.0 with “TypeError: Cannot convert undefined or null to object” #8620

Closed
@mmkkkkzz

Description

@mmkkkkzz

[REQUIRED] Environment info

firebase-tools: 14.4.0
Platform: macOS

[REQUIRED] Test case

Project structure:

frontend/
├── .firebaserc
├── .gitignore
├── apphosting.yaml
├── components.json
├── firebase-debug.log
├── firebase.json
├── next-env.d.ts
├── next.config.ts
├── package-lock.json
├── package.json
├── postcss.config.mjs
├── README.md
├── tsconfig.json
├── .next/
├── node_modules/
└── src/
├── app/
├── components/
└── lib/

[REQUIRED] Steps to reproduce

1.	Ensure the `firebase.json` is configured as follows:
{
  "apphosting": {
    "backendId": "xxx",
    "rootDir": "/",
    "ignore": [
      "node_modules",
      ".git",
      "firebase-debug.log",
      "firebase-debug.*.log",
      "functions"
    ]
  },
  "emulators": {
    "apphosting": {
      "port": 5002,
      "rootDirectory": "./"
    },
    "ui": {
      "enabled": true,
      "port": 8000
    },
    "singleProjectMode": true
  }
}
2.	Run the emulator:

firebase emulators:start

[REQUIRED] Expected behavior

The App Hosting emulator should start successfully with the following output:

i emulators: Starting emulators: apphosting
i apphosting: starting app with: 'npm run dev'

[email protected] dev
next dev --turbopack

⚠ emulators: The Emulator UI is not starting, either because none of the running emulators have a UI component or the Emulator UI cannot determine the Project ID. Pass the --project flag to specify a project.
i apphosting: connecting apphosting emulator

...
✓ Ready in 771ms

[REQUIRED] Actual behavior

The following error occurs when starting the App Hosting emulator:

[debug] [2025-05-17T06:42:28.751Z] TypeError: Cannot convert undefined or null to object
at Function.values ()
at tripFirebasePostinstall (/.../firebase-tools/lib/emulator/apphosting/serve.js:138:41)
at serve (/.../firebase-tools/lib/emulator/apphosting/serve.js:96:15)
...

This issue appears only in version 14.4.0.
Downgrading to version 13.3.1 resolves the issue.

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