Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'match' of undefined (AWS Deploy) #6202

Open
filypsdias opened this issue Jun 1, 2019 · 4 comments
Open

Cannot read property 'match' of undefined (AWS Deploy) #6202

filypsdias opened this issue Jun 1, 2019 · 4 comments

Comments

@filypsdias
Copy link

This is a Bug Report

Description

  • What went wrong? Cannot read property 'match' of undefined
  • What did you expect should have happened? Deploy my app into AWS
  • What was the config you used? Windows 10 - Node runtime 8.10
  • What stacktrace or error message from your provider did you see?

Similar or dependent issues:

  • Did not find any like that

Additional Data

  • Serverless Framework Version you're using: 1.40.0
  • Operating System: win32
  • Stack Trace:

image

@llabati
Copy link

llabati commented Jun 5, 2019

Same problem : I try to deploy my app on AWS Lambda, I use a Mac, and the message is "cannot read property 'trim' of undefined.

@Mantheshmanju
Copy link

go to serverless.yml and update nodejs version to latest it will work

@ktwbc
Copy link

ktwbc commented Nov 24, 2020

I just got this error on a new project which does not have an http event, I just a lambda function (because it's an edge function). It created a brand new stack and shows successful under cloudformation but the output of the sls deploy fails because it's looking for an API Gateway that does not exist in that instance.

edgeSetHeaders:
  handler: src/public/controllers/edge.edgeSetHeaders
  memorySize: 128
  timeout: 30

       TypeError: Cannot read property 'match' of undefined
      at /Volumes/dev/cent-api/node_modules/serverless-apigw-binary/src/index.js:19:30
      at tryCatcher (/Volumes/dev/cent-api/node_modules/bluebird/js/release/util.js:16:23)
      at Promise._settlePromiseFromHandler (/Volumes/dev/cent-api/node_modules/bluebird/js/release/promise.js:547:31)
      at Promise._settlePromise (/Volumes/dev/cent-api/node_modules/bluebird/js/release/promise.js:604:18)
      at Promise._settlePromise0 (/Volumes/dev/cent-api/node_modules/bluebird/js/release/promise.js:649:10)
      at Promise._settlePromises (/Volumes/dev/cent-api/node_modules/bluebird/js/release/promise.js:729:18)
      at _drainQueueStep (/Volumes/dev/cent-api/node_modules/bluebird/js/release/async.js:93:12)
      at _drainQueue (/Volumes/dev/cent-api/node_modules/bluebird/js/release/async.js:86:9)
      at Async._drainQueues (/Volumes/dev/cent-api/node_modules/bluebird/js/release/async.js:102:5)
      at Immediate.Async.drainQueues [as _onImmediate] (/Volumes/dev/cent-api/node_modules/bluebird/js/release/async.js:15:14)
      at processImmediate (internal/timers.js:461:21)
 
     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
 
    getApiId(stage) {
    return new Promise(resolve => {
      this.provider.request('CloudFormation', 'describeStacks', { StackName: this.provider.naming.getStackName(stage) }).then(resp => {
        const output = resp.Stacks[0].Outputs;
        let apiUrl;
        output.filter(entry => entry.OutputKey.match('ServiceEndpoint')).forEach(entry => apiUrl = entry.OutputValue);
        const apiId = apiUrl.match('https:\/\/(.*)\\.execute-api')[1];
        resolve(apiId);
      });
    });
  }

@scottgit
Copy link

For me, the problem stemmed from a misaligned yml file, where I had a Resource not nested under the Task. But I think this type of error could potentially occur with any misaligned definition in a yml file, as servereless attempts to check various things for the deployment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants