Skip to content

Functions emulator does not work with yarn configured with pnpm nodeLinker #10813

Description

@blikblum

[REQUIRED] Environment info

firebase-tools: 15.24.0

Platform: Ubuntu

[REQUIRED] Test case

The repository below contains a minimal firebase functions setup in a yarn with pnpm nodeLinker setup

Clone, execute yarn, cd functions, yarn serve

https://github.com/blikblum/firebase-functions-yarn

[REQUIRED] Steps to reproduce

  • Init a yarn package
  • Configure nodeLinker to pnpn
  • Run firebase init configuring functions (vanilla javascript) and functions emulator
  • Run yarn install
  • Run cd functions
  • Run yarn serve

[REQUIRED] Expected behavior

The functions emulator should start without errors

[REQUIRED] Actual behavior

yarn serve fails with error "Failed to load function definition from source: FirebaseError: Failed to find location of Firebase Functions SDK. Please file a bug on Github (https://github.com/firebase/firebase-tools/)."

[2026-07-18T13:00:20.859Z] ----------------------------------------------------------------------
[2026-07-18T13:00:20.860Z] Command: /home/luiz/.nvm/versions/node/v24.12.0/bin/node /home/luiz/.nvm/versions/node/v24.12.0/bin/firebase emulators:start --only functions --debug
[2026-07-18T13:00:20.861Z] CLI Version: 15.24.0
[2026-07-18T13:00:20.861Z] Platform: linux
[2026-07-18T13:00:20.861Z] Node Version: v24.12.0
[2026-07-18T13:00:20.861Z] Detected Agent: unknown
[2026-07-18T13:00:20.861Z] Time: Sat Jul 18 2026 10:00:20 GMT-0300 (Horário Padrão de Brasília)
[2026-07-18T13:00:20.861Z] ----------------------------------------------------------------------

[2026-07-18T13:00:21.279Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2026-07-18T13:00:21.279Z] > authorizing via signed-in user
i emulators: Starting emulators: functions {"metadata":{"emulator":{"name":"hub"},"message":"Starting emulators: functions"}}
i emulators: Detected demo project ID "demo-no-project", emulated services will use a demo configuration and attempts to access non-emulated services for this project will fail. {"metadata":{"emulator":{"name":"hub"},"message":"Detected demo project ID "demo-no-project", emulated services will use a demo configuration and attempts to access non-emulated services for this project will fail."}}
[2026-07-18T13:00:21.282Z] [logging] Logging Emulator only supports listening on one address (127.0.0.1). Not listening on ::1
[2026-07-18T13:00:21.282Z] assigned listening specs for emulators {"user":{"hub":[{"address":"127.0.0.1","family":"IPv4","port":4400},{"address":"::1","family":"IPv6","port":4400}],"ui":[{"address":"127.0.0.1","family":"IPv4","port":4000},{"address":"::1","family":"IPv6","port":4000}],"logging":[{"address":"127.0.0.1","family":"IPv4","port":4500}]},"metadata":{"message":"assigned listening specs for emulators"}}
[2026-07-18T13:00:21.285Z] Write emulator hub locator at /tmp/hub-demo-no-project.json
[2026-07-18T13:00:21.288Z] [functions] Functions Emulator only supports listening on one address (127.0.0.1). Not listening on ::1
[2026-07-18T13:00:21.288Z] [eventarc] Eventarc Emulator only supports listening on one address (127.0.0.1). Not listening on ::1
[2026-07-18T13:00:21.288Z] [tasks] Cloud Tasks Emulator only supports listening on one address (127.0.0.1). Not listening on ::1
[2026-07-18T13:00:21.289Z] late-assigned ports for functions and eventarc emulators {"user":{"hub":[{"address":"127.0.0.1","family":"IPv4","port":4400},{"address":"::1","family":"IPv6","port":4400}],"ui":[{"address":"127.0.0.1","family":"IPv4","port":4000},{"address":"::1","family":"IPv6","port":4000}],"logging":[{"address":"127.0.0.1","family":"IPv4","port":4500}],"functions":[{"address":"127.0.0.1","family":"IPv4","port":5001}],"eventarc":[{"address":"127.0.0.1","family":"IPv4","port":9299}],"tasks":[{"address":"127.0.0.1","family":"IPv4","port":9499}]},"metadata":{"message":"late-assigned ports for functions and eventarc emulators"}}
[2026-07-18T13:00:21.297Z] defaultcredentials: writing to file /home/luiz/.config/firebase/XXX_gmail.com_application_default_credentials.json
[2026-07-18T13:00:21.298Z] Setting GAC to /home/luiz/.config/firebase/XXX_gmail.com_application_default_credentials.json {"metadata":{"emulator":{"name":"functions"},"message":"Setting GAC to /home/luiz/.config/firebase/XXX_gmail.com_application_default_credentials.json"}}
i functions: Watching "/home/luiz/repositories/firebase-functions-yarn/functions" for Cloud Functions... {"metadata":{"emulator":{"name":"functions"},"message":"Watching "/home/luiz/repositories/firebase-functions-yarn/functions" for Cloud Functions..."}}
[2026-07-18T13:00:21.307Z] Validating nodejs source
[2026-07-18T13:00:21.643Z] > [functions] package.json contents: {
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"serve": "firebase emulators:start --only functions",
"shell": "firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"engines": {
"node": "24"
},
"main": "index.js",
"dependencies": {
"firebase-admin": "^13.6.0",
"firebase-functions": "^7.0.0"
},
"devDependencies": {
"firebase-functions-test": "^3.4.1"
},
"private": true
}
[2026-07-18T13:00:21.643Z] Building nodejs source
[2026-07-18T13:00:21.643Z] Failed to find version of module node: reached end of search path /home/luiz/repositories/firebase-functions-yarn/functions/node_modules
✔ functions: Using node@24 from host.
[2026-07-18T13:00:21.645Z] Could not find functions.yaml. Must use http discovery
⬢ functions: Failed to load function definition from source: FirebaseError: Failed to find location of Firebase Functions SDK. Please file a bug on Github (https://github.com/firebase/firebase-tools/). {"metadata":{"emulator":{"name":"functions"},"message":"Failed to load function definition from source: FirebaseError: Failed to find location of Firebase Functions SDK. Please file a bug on Github (https://github.com/firebase/firebase-tools/)."}}
[2026-07-18T13:00:21.653Z] Could not find VSCode notification endpoint: TypeError: fetch failed. If you are not running the Firebase SQL Connect VSCode extension, this is expected and not an issue.

┌─────────────────────────────────────────────────────────────┐
│ ✔ All emulators ready! It is now safe to connect your app. │
│ i View Emulator UI at http://127.0.0.1:4000/
└─────────────────────────────────────────────────────────────┘

┌───────────┬────────────────┬─────────────────────────────────┐
│ Emulator │ Host:Port │ View in Emulator UI │
├───────────┼────────────────┼─────────────────────────────────┤
│ Functions │ 127.0.0.1:5001 │ http://127.0.0.1:4000/functions
└───────────┴────────────────┴─────────────────────────────────┘
Emulator Hub host: 127.0.0.1 port: 4400
Other reserved ports: 4500

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