Skip to content

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

Closed

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.

Activity

  1. inlined commented on Oct 31, 2022

    @inlined
    Member

    We've recently discovered a bug with the 4.0 SDK and workspaces. We have a temporary fix coming out very soon that will unlock the functionality of older SDKs, but some V2 functions require a deeper fix. Stay tuned.

  2. TrustyTechSG commented on Nov 1, 2022

    @TrustyTechSG
    Author

    Thank you for the reply @inlined, just asking is this update also going to support deploy function with unpublished local workspace dependency? currently I notice the deploy process assume all dependencies are publish available, which is not true for workspace use case, we have many unpublished dependencies.

  3. taeold commented on Nov 2, 2022

    @taeold
    Contributor

    Same bug, reported on #5517. Noted here for cross-tracking.

  4. taeold commented on Nov 7, 2022

    @taeold
    Contributor

    Also similar bug in #5145.

  5. taeold commented on Nov 7, 2022

    @taeold
    Contributor

    We reverted back the change that broke many users in v4.0.2 of the firebase functions sdk.

    We are working on a long term solution to make the function deployment aware of workspaces and other dev toolings that changes where npm packages are installed (e.g. pnpm).

    In the meantime, please give 4.0.2 a try. Would appreciate your feedbacks.

    See #5517 for more info.

  6. self-assigned this
    on Nov 7, 2022
  7. joehan commented on Feb 14, 2023

    @joehan
    Member

    Closing since I beleive #5215 fixed this.

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