Skip to content

firebase deploy --only functions run successfully without deploy any function if run within yarn workspace (Already nohoist every dependency).  #5191

@TrustyTechSG

Description

@TrustyTechSG

[REQUIRED] Environment info

**firebase-tools:**11.15.0

Platform: MacOS 13.0

[REQUIRED] Test case

index.js

import functions from "firebase-functions";

export const hello = functions.https.onRequest((request, response) => {
  response.send("Hello from Firebase!");
});

package.json

{
  "name": "test",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "private": true,
  "sideEffects": false,
  "mode": "production",
  "type": "module",
  "scripts": {
    "start": "npm run shell"
  },
  "dependencies": {
    "firebase-functions": "^4.0.1"
  },
  "engines": {
    "node": "16"
  }
}

firebase.json

{
  "functions": [
    {
      "source": "/",
      "codebase": "test"
    }
  ]
}

[REQUIRED] Steps to reproduce

  1. Put the above package.json, index.js and firebase.json into test folder under a simple yarn workspace
    /root
    /packages/test
    /package.json (worksapce package.json)
{
  "name": "testing",
  "private": true,
  "workspaces": {
    "packages": [
      "packages/*"
    ],
    "nohoist": [
      "**/firebase-admin",
      "**/firebase-admin/**",
      "**/firebase-functions",
      "**/firebase-functions/**"
    ]
  },
}
  1. Run yarn, and cd to packages/test to verify all dependency are installed locally (within the same folder)
  2. Run firebase deploy --only functions.

[REQUIRED] Expected behavior

Function hello been successfully created.

[REQUIRED] Actual behavior

deploy command run successfully without error, but no function deployed.

Now, simply copy the packages/test folder to anywhere outside the workspace root and cd to the new folder immediately run: firebase deploy --only functions. Function hello successfully deployed.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions