components icon indicating copy to clipboard operation
components copied to clipboard

"service" property is missing in serverless.js

Open kueckermann opened this issue 5 years ago • 1 comments

Description

When trying to deploy a serverless component with serverless deploy using a javascript file for inputs, it fails with "service" property is missing in serverless.js.

I have tested this most recently with the express component, but have also faced the same issue with the website component.

Additional Data

My Org Name / My App Name in the examples below are just placeholders. I use my real app and org name in the deployments I have tested with.

serverless.json works

{
    "component": "express",
    "name": "My App Name",
    "app": "My App Name",
    "org": "My Org Name",
    "inputs": {
        "src": "./"
    }
}

serverless.yml works

component: express
name: My App Name
app: My App Name
org: My Org Name

inputs:
    src: ./

serverless.js fails with "service" property is missing in serverless.js

module.exports = {
    "component": "express",
    "name": "My App Name",
    "app": "My App Name",
    "org": "My Org Name",
    "inputs": {
        "src": "./"
    }
}

Operating System: darwin Node Version: 12.16.3 Framework Version: 1.78.1 Plugin Version: 3.7.0 SDK Version: 2.3.1 Components Version: 2.34.3

kueckermann avatar Aug 16 '20 15:08 kueckermann

Yeah the components CLI is completely different from the framework CLI, and it does not support serverless.js. I'm gonna keep this open though as a feature request as this might be useful.

Just remember, whatever works in the Serverless Framework does not necessarily mean it's available in the components CLI. (ie. not all variables are supported in components)

eahefnawy avatar Aug 24 '20 09:08 eahefnawy