firebase-functions icon indicating copy to clipboard operation
firebase-functions copied to clipboard

package.json validation breaks deploys for yarn workspace nohoist

Open kristfal opened this issue 3 years ago • 8 comments

Related issues

[REQUIRED] Version info

node: v16.13.2 firebase-functions: 3.11.0 firebase-tools: 10.1.4 firebase-admin: 9.2.0

[REQUIRED] Test case

Add the following object to package.json

  "workspaces": {
    "nohoist": [
      "example-package-name"
    ]
  },
  "engines": {
    "node": "16"
  },

[REQUIRED] Steps to reproduce

Run firebase deploy

[REQUIRED] Expected behavior

Successful deployment

[REQUIRED] Actual behavior

Failed deployment

{
  "@type": "type.googleapis.com/google.cloud.audit.AuditLog",
  "status": {
    "code": 3,
    "message": "Build failed: npm ERR! code EWORKSPACESCONFIG\nnpm ERR! workspaces config expects an Array\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     /www-data-home/.npm/_logs/2022-03-01T15_39_30_803Z-debug.log; Error ID: b0ba1f57"
  },
  "authenticationInfo": {
    "principalEmail": "REDACTED"
  },
  "serviceName": "cloudfunctions.googleapis.com",
  "methodName": "google.cloud.functions.v1.CloudFunctionsService.UpdateFunction",
  "resourceName": "REDACTED"
}

Were you able to successfully deploy your functions?

Downgrading to node 14 or removing workspaces entry in package.json solves the issue.

Misc

The schema validation of package.json used to not allow objects. This has been resolved in a later version of schemastore.

See comment: https://github.com/microsoft/vscode/issues/77912#issuecomment-515391585

kristfal avatar Mar 01 '22 15:03 kristfal

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Mar 01 '22 15:03 google-oss-bot

I have the same problem trying to update to Node 16 using firebase tools to deploy.

thomasdrouin avatar May 25 '22 11:05 thomasdrouin

same here, just upgraded to Node 16, tried to deploy a function using npm version 8.12.1

efstathiosntonas avatar Jun 06 '22 07:06 efstathiosntonas

This is still an issue with a relatively simple fix. Would love to see this fixed.

kristfal avatar Sep 08 '22 14:09 kristfal

Taking a look. I think we may need to escalate this issue to Google Cloud Functions team.

taeold avatar Nov 02 '22 19:11 taeold

Hi, any news on this? We're still not able to deploy node 16 functions on monorepos. It's been 9 months since this issue has been introduced and it's an endless ping pong between google teams.

efstathiosntonas avatar Dec 06 '22 09:12 efstathiosntonas

Is there a solution for this yet? We are having the same problem, and it looks like the fix is simple

Muritavo avatar Mar 22 '23 00:03 Muritavo

@Muritavo we switched to aws lambda because of this. Google lost a good amount of income from us. They don’t give a shit, we don’t give a shit. Simple as that.

efstathiosntonas avatar Mar 22 '23 05:03 efstathiosntonas