Skip to content

Serverless plugin "serverless-google-cloudfunctions" initialization errored: Unexpected token ) #110

Closed
@knitterb

Description

@knitterb

When doing a fresh install of the plugins (npm install) I get the error in the title when issuing the serverless help command. Further debugging profiles the following:

SyntaxError: Unexpected token )
node_modules/serverless-google-cloudfunctions/package/lib/compileFunctions.js:43
      );
      ^

I took a look in the file and there appears to be an extra comma that is not tolerated:

40      funcTemplate.properties.labels = _.assign({},
41        _.get(this, 'serverless.service.provider.labels') || {},
42        _.get(funcObject, 'labels') || {},
43      );
44
45      const eventType = Object.keys(funcObject.events[0])[0];

The comma at the end of line 42, when removed, let's everything function as it should.

  Your Environment Information -----------------------------
     OS:                     darwin
     Node Version:           6.11.5
     Serverless Version:     1.28.0

Let me know what else I can provide to help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions