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

Failure: Debug Failure. False expression. #228

Open
andrevandal opened this issue Jul 23, 2020 · 5 comments
Open

Failure: Debug Failure. False expression. #228

andrevandal opened this issue Jul 23, 2020 · 5 comments

Comments

@andrevandal
Copy link

andrevandal commented Jul 23, 2020

This is a Bug Report

Description

  • What went wrong?
    Upon receiving a request with @dazn/lambda-powertools-pattern-basic on, the server closes unexpectedly.
  • What did you expect should have happened?
    Return the object informed in the function.
  • What was the config (if any) you used?
    I'm using two serverless plugins serverless-bundle and serverless-offline with this debug command cross-env NODE_ENV=development SLS_DEBUG=* node --inspect ./node_modules/.bin/serverless -s dev offline start.

my function:

import { APIGatewayProxyHandler } from 'aws-lambda'
import warp from '@dazn/lambda-powertools-pattern-basic'

const dispatch: APIGatewayProxyHandler = async (event, _context) => {
  return {
    statusCode: 200,
    body: JSON.stringify(
      {
        message:
          'Go Serverless Webpack (Typescript) v1.0! Your function executed successfully!',
        input: event
      },
      null,
      2
    )
  }
}

export default warp(dispatch)
  • What stacktrace or error message did you see?
offline: POST /dev/posts/1 (λ: actions.dispatch)
[offline] contentType: application/json
[offline] requestTemplate: #define( $loop )
{
#foreach($key in $map.keySet())
  "$util.escapeJavaScript($key)":
    "$util.escapeJavaScript($map.get($key))"
    #if( $foreach.hasNext ) , #end
#end
}
#end
{
  "body": $input.json("$"),
  "method": "$context.httpMethod",
  "principalId": "$context.authorizer.principalId",
  "stage": "$context.stage",
  "cognitoPoolClaims" : {
      "sub": "$context.authorizer.claims.sub"
  },
  #set( $map = $context.authorizer )
  ## see https://github.com/serverless/serverless/issues/4374
  "enhancedAuthContext": {
    #foreach($key in $map.keySet())
      ## The claims are not part of the enhancedAuthContext in serverless and should be excluded.
      ## However it is more practical to set this property to null as defined in
      ## https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html#context-variable-reference
      #if($key == "claims")
      "$key": null
      #else
      "$key": "$util.escapeJavaScript($map.get($key))"
      #end
      #if($foreach.hasNext),#end
    #end
  },
  #set( $map = $input.params().header )
  "headers": $loop,
  #set( $map = $input.params().querystring )
  "query": $loop,
  #set( $map = $input.params().path )
  "path": $loop,
  #set( $map = $context.identity )
  "identity": $loop,
  #set( $map = $stageVariables )
  "stageVariables": $loop,
  "requestPath": "$context.resourcePath"
}

[offline] payload: { foo: 'bar' }
[offline] _____ REQUEST TEMPLATE PROCESSING _____
[offline] Velocity rendered: {
  "body": {"foo":"bar"},
  "method": "POST",
  "principalId": "offlineContext_authorizer_principalId",
  "stage": "dev",
  "cognitoPoolClaims" : {
      "sub": ""
  },
      "enhancedAuthContext": {
                                  "principalId": "offlineContext_authorizer_principalId"
                  },
    "headers": {
  "Host":
    "localhost:3000"
     ,   "User-Agent":
    "insomnia/2020.3.3"
     ,   "Content-Type":
    "application/json"
     ,   "Accept":
    "*/*"
     ,   "Content-Length":
    "17"
    }
,
    "query": {
}
,
    "path": {
  "id":
    "1"
    }
,
    "identity": {
  "accountId":
    "offlineContext_accountId"
     ,   "apiKey":
    "offlineContext_apiKey"
     ,   "apiKeyId":
    "offlineContext_apiKeyId"
     ,   "caller":
    "offlineContext_caller"
     ,   "cognitoAuthenticationProvider":
    "offlineContext_cognitoAuthenticationProvider"
     ,   "cognitoAuthenticationType":
    "offlineContext_cognitoAuthenticationType"
     ,   "sourceIp":
    "127.0.0.1"
     ,   "user":
    "offlineContext_user"
     ,   "userAgent":
    "insomnia/2020.3.3"
     ,   "userArn":
    "offlineContext_userArn"
    }
,
    "stageVariables": {
}
,
  "requestPath": "/posts/1"
}

[offline] event: {
  body: { foo: 'bar' },
  method: 'POST',
  principalId: 'offlineContext_authorizer_principalId',
  stage: 'dev',
  cognitoPoolClaims: { sub: '' },
  enhancedAuthContext: { principalId: 'offlineContext_authorizer_principalId' },
  headers: {
    Host: 'localhost:3000',
    'User-Agent': 'insomnia/2020.3.3',
    'Content-Type': 'application/json',
    Accept: '*/*',
    'Content-Length': '17'
  },
  query: {},
  path: { id: '1' },
  identity: {
    accountId: 'offlineContext_accountId',
    apiKey: 'offlineContext_apiKey',
    apiKeyId: 'offlineContext_apiKeyId',
    caller: 'offlineContext_caller',
    cognitoAuthenticationProvider: 'offlineContext_cognitoAuthenticationProvider',
    cognitoAuthenticationType: 'offlineContext_cognitoAuthenticationType',
    sourceIp: '127.0.0.1',
    user: 'offlineContext_user',
    userAgent: 'insomnia/2020.3.3',
    userArn: 'offlineContext_userArn'
  },
  stageVariables: {},
  requestPath: '/posts/1'
}
[offline] Loading handler... (/home/derevandal/projetcs/serverless/.webpack/service/src/functions/actions/dispatch)
[offline] _____ HANDLER RESOLVED _____
offline: Failure: Debug Failure. False expression.
Error: Debug Failure. False expression.
    at getConstructorDefinedThisAssignmentTypes (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:41882:22)
    at getWidenedTypeForAssignmentDeclaration (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:41725:63)
    at getTypeOfVariableOrParameterOrPropertyWorker (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:42090:24)
    at getTypeOfVariableOrParameterOrProperty (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:42038:28)
    at getTypeOfSymbol (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:42366:24)
    at checkPropertyAccessExpressionOrQualifiedName (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:57184:53)
    at checkPropertyAccessExpression (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:57043:17)
    at checkExpressionWorker (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:61676:28)
    at checkExpression (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:61597:38)
    at checkPrefixUnaryExpression (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:60364:31)
    at checkExpressionWorker (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:61713:28)
    at checkExpression (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:61597:38)
    at checkTruthinessExpression (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:64162:42)
    at checkIfStatement (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:64071:24)
    at checkSourceElementWorker (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:66596:28)
    at checkSourceElement (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:66472:17)
    at Object.forEach (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:317:30)
    at checkBlock (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:63707:20)
    at checkSourceElementWorker (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:66590:28)
    at checkSourceElement (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:66472:17)
    at checkWhileStatement (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:64153:13)
    at checkSourceElementWorker (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:66600:28)
    at checkSourceElement (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:66472:17)
    at Object.forEach (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:317:30)
    at checkBlock (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:63703:20)
    at checkSourceElementWorker (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:66590:28)
    at checkSourceElement (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:66472:17)
    at checkFunctionExpressionOrObjectLiteralMethodDeferred (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:60153:21)
    at checkDeferredNode (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:66757:21)
    at Map.forEach (<anonymous>)
    at checkDeferredNodes (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:66735:37)
    at checkSourceFileWorker (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:66811:17)
    at checkSourceFile (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:66777:13)
    at getDiagnosticsWorker (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:66865:17)
    at getDiagnostics (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:66851:24)
    at Object.getEmitResolver (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:35685:13)
    at emitWorker (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:100827:69)
    at /home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:100808:66
    at runWithCancellationToken (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:100904:24)
    at Object.emit (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:100808:20)
    at Object.getFileEmitOutput (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:102672:26)
    at Object.getEmitOutput (/home/derevandal/projetcs/serverless/node_modules/typescript/lib/typescript.js:139562:23)
    at getOutput (/home/derevandal/projetcs/serverless/node_modules/ts-node/src/index.ts:562:32)
    at Object.compile (/home/derevandal/projetcs/serverless/node_modules/ts-node/src/index.ts:775:32)
    at Module.m._compile (/home/derevandal/projetcs/serverless/node_modules/ts-node/src/index.ts:858:43)
    at Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Object.require.extensions.<computed> [as .js] (/home/derevandal/projetcs/serverless/node_modules/ts-node/src/index.ts:861:12)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at /home/derevandal/projetcs/serverless/node_modules/serverless-offline/dist/lambda/handler-runner/in-process-runner/InProcessRunner.js:67:133
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at InProcessRunner.run (/home/derevandal/projetcs/serverless/node_modules/serverless-offline/dist/lambda/handler-runner/in-process-runner/InProcessRunner.js:67:9)
[offline] Using response 'default'
[offline] _____ RESPONSE PARAMETERS PROCCESSING _____
[offline] Found 0 responseParameters for 'default' response

Additional Data

  • Which powertool package are you using?:
    After much debugging, I believe the problem is related to package @dazn/lambda-powertools-middleware-correlation-ids.
    When I run with @dazn/lambda-powertools-middleware-sample-logging and @dazn/lambda-powertools-middleware-log-timeout enabled, no error occurs.

  • Which version are you using?:

"dependencies": {
    "@dazn/lambda-powertools-correlation-ids": "^1.24.1",
    "@dazn/lambda-powertools-middleware-correlation-ids": "^1.24.1",
    "@dazn/lambda-powertools-middleware-log-timeout": "^1.24.1",
    "@dazn/lambda-powertools-middleware-sample-logging": "^1.24.1",
    "@dazn/lambda-powertools-pattern-basic": "^1.24.1",
}
  • Middy engine version you're using:
    "@middy/core": "^1.0.0",
  • Operating System:
    W10 - WSL2 with Ubuntu 20.04

While debugging the package, I realized that the Webpack cannot find the following files but I don't know why:

const eventSources = [
  require('./event-sources/api-gateway'),
  require('./event-sources/alb'),
  require('./event-sources/sns'),
  require('./event-sources/sqs'),
  require('./event-sources/kinesis'),
  require('./event-sources/dynamodb'),
  require('./event-sources/firehose'),
  require('./event-sources/eventbridge'),
  require('./event-sources/direct-invoke')
]
@theburningmonk
Copy link
Contributor

@derevandal thanks for reporting this, so does this happen with the deployed function as well, or only when you run it locally with serverless-offline? Also, does it still happen if you remove the serverless-bundle plugin?

@lkhari
Copy link
Contributor

lkhari commented Jul 24, 2020

Depending on the bundle configuration, when running locally you may sometimes stumble into errors with the event-sources because aws-sdk is a dev dependency in the @dazn/lambda-powertools-middleware-correlation-ids library, but is very much needed for dynamodb event source.

This usually isn't a problem in lambda since accessing aws-sdk is there by default. But running locally you should probably have aws-sdk as a dependencies in your package.json

@andrevandal
Copy link
Author

Depending on the bundle configuration, when running locally you may sometimes stumble into errors with the event-sources because aws-sdk is a dev dependency in the @dazn/lambda-powertools-middleware-correlation-ids library, but is very much needed for dynamodb event source.

This usually isn't a problem in lambda since accessing aws-sdk is there by default. But running locally you should probably have aws-sdk as a dependencies in your package.json

I thought I forgot to make this addition ... But no.
This dependency is already in package.json. Sorry :(

@derevandal thanks for reporting this, so does this happen with the deployed function as well, or only when you run it locally with serverless-offline? Also, does it still happen if you remove the serverless-bundle plugin?

I tried to deploy with cross-env NODE_ENV=development SLS_DEBUG=* sls deploy --stage $NODE_ENV and received the following error:

yarn run v1.22.4
$ cross-env NODE_ENV=development sls deploy --stage $NODE_ENV
Serverless: Bundling with Webpack...
Starting type checking service...
Serverless: No external modules needed
Serverless: Packaging service...

  Type Error ---------------------------------------------

  TypeError: this.getStage(...).toUpperCase is not a function
      at AwsProvider.getCredentials (/home/derevandal/projetcs/serverless/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:371:58)
      at AwsProvider.request (/home/derevandal/projetcs/serverless/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:241:48)
      at AwsDeploy.<anonymous> (/home/derevandal/projetcs/serverless/node_modules/serverless/lib/plugins/aws/deploy/lib/createStack.js:73:12)
  From previous event:
      at AwsDeploy.createStack (/home/derevandal/projetcs/serverless/node_modules/serverless/lib/plugins/aws/deploy/lib/createStack.js:71:8)
  From previous event:
      at Object.aws:deploy:deploy:createStack [as hook] (/home/derevandal/projetcs/serverless/node_modules/serverless/lib/plugins/aws/deploy/index.js:99:67)
      at /home/derevandal/projetcs/serverless/node_modules/serverless/lib/classes/PluginManager.js:483:55
  From previous event:
      at PluginManager.invoke (/home/derevandal/projetcs/serverless/node_modules/serverless/lib/classes/PluginManager.js:483:22)
      at PluginManager.spawn (/home/derevandal/projetcs/serverless/node_modules/serverless/lib/classes/PluginManager.js:503:17)
      at AwsDeploy.<anonymous> (/home/derevandal/projetcs/serverless/node_modules/serverless/lib/plugins/aws/deploy/index.js:93:48)
  From previous event:
      at Object.deploy:deploy [as hook] (/home/derevandal/projetcs/serverless/node_modules/serverless/lib/plugins/aws/deploy/index.js:89:30)
      at /home/derevandal/projetcs/serverless/node_modules/serverless/lib/classes/PluginManager.js:483:55
  From previous event:
      at PluginManager.invoke (/home/derevandal/projetcs/serverless/node_modules/serverless/lib/classes/PluginManager.js:483:22)
      at /home/derevandal/projetcs/serverless/node_modules/serverless/lib/classes/PluginManager.js:518:24
  From previous event:
      at PluginManager.run (/home/derevandal/projetcs/serverless/node_modules/serverless/lib/classes/PluginManager.js:518:8)
      at /home/derevandal/projetcs/serverless/node_modules/serverless/lib/Serverless.js:133:33
  From previous event:
      at Serverless.run (/home/derevandal/projetcs/serverless/node_modules/serverless/lib/Serverless.js:120:74)
      at /home/derevandal/projetcs/serverless/node_modules/serverless/scripts/serverless.js:54:26
      at processImmediate (internal/timers.js:456:21)
  From previous event:
      at Object.<anonymous> (/home/derevandal/projetcs/serverless/node_modules/serverless/scripts/serverless.js:54:4)
      at Module._compile (internal/modules/cjs/loader.js:1137:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
      at Module.load (internal/modules/cjs/loader.js:985:32)
      at Function.Module._load (internal/modules/cjs/loader.js:878:14)
      at Module.require (internal/modules/cjs/loader.js:1025:19)
      at require (internal/modules/cjs/helpers.js:72:18)
      at Object.<anonymous> (/home/derevandal/projetcs/serverless/node_modules/serverless/bin/serverless.js:41:1)
      at Module._compile (internal/modules/cjs/loader.js:1137:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
      at Module.load (internal/modules/cjs/loader.js:985:32)
      at Function.Module._load (internal/modules/cjs/loader.js:878:14)
      at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
      at internal/main/run_main_module.js:17:47

     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information ---------------------------
     Operating System:          linux
     Node Version:              12.18.3
     Framework Version:         1.76.1
     Plugin Version:            3.6.17
     SDK Version:               2.3.1
     Components Version:        2.32.0

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
❯ yarn deploy
yarn run v1.22.4
$ cross-env NODE_ENV=development SLS_DEBUG=* sls deploy --stage $NODE_ENV
Serverless: Load command interactiveCli
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command config:tabcompletion
Serverless: Load command config:tabcompletion:install
Serverless: Load command config:tabcompletion:uninstall
Serverless: Load command create
Serverless: Load command install
Serverless: Load command package
Serverless: Load command deploy
Serverless: Load command deploy:function
Serverless: Load command deploy:list
Serverless: Load command deploy:list:functions
Serverless: Load command invoke
Serverless: Load command invoke:local
Serverless: Load command info
Serverless: Load command logs
Serverless: Load command metrics
Serverless: Load command print
Serverless: Load command remove
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command slstats
Serverless: Load command plugin
Serverless: Load command plugin
Serverless: Load command plugin:install
Serverless: Load command plugin
Serverless: Load command plugin:uninstall
Serverless: Load command plugin
Serverless: Load command plugin:list
Serverless: Load command plugin
Serverless: Load command plugin:search
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command upgrade
Serverless: Load command uninstall
Serverless: Load command webpack
Serverless: Load command offline
Serverless: Load command offline:start
Serverless: Load command login
Serverless: Load command logout
Serverless: Load command generate-event
Serverless: Load command test
Serverless: Load command dashboard
Serverless: Load command output
Serverless: Load command output:get
Serverless: Load command output:list
Serverless: Load command param
Serverless: Load command param:get
Serverless: Load command param:list
Serverless: Load command studio
Serverless: Load command dev
Serverless: Invoke deploy
Serverless: Invoke package
Serverless: Invoke aws:common:validate
Serverless: Invoke aws:common:cleanupTempDir
Serverless: Invoke webpack:validate
Serverless: Invoke webpack:compile
Serverless: Bundling with Webpack...
Starting type checking service...
Serverless: Invoke webpack:package
Serverless: No external modules needed
Serverless: Packaging service...
Serverless: Invoke aws:package:finalize
Serverless: Invoke aws:common:moveArtifactsToPackage
Serverless: Invoke aws:common:validate
Serverless: Invoke aws:deploy:deploy

  Type Error ---------------------------------------------

  TypeError: this.getStage(...).toUpperCase is not a function
      at AwsProvider.getCredentials (/home/derevandal/projetcs/serverless/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:371:58)
      at AwsProvider.request (/home/derevandal/projetcs/serverless/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:241:48)
      at AwsDeploy.<anonymous> (/home/derevandal/projetcs/serverless/node_modules/serverless/lib/plugins/aws/deploy/lib/createStack.js:73:12)
  From previous event:
      at AwsDeploy.createStack (/home/derevandal/projetcs/serverless/node_modules/serverless/lib/plugins/aws/deploy/lib/createStack.js:71:8)
  From previous event:
      at Object.aws:deploy:deploy:createStack [as hook] (/home/derevandal/projetcs/serverless/node_modules/serverless/lib/plugins/aws/deploy/index.js:99:67)
      at /home/derevandal/projetcs/serverless/node_modules/serverless/lib/classes/PluginManager.js:483:55
  From previous event:
      at PluginManager.invoke (/home/derevandal/projetcs/serverless/node_modules/serverless/lib/classes/PluginManager.js:483:22)
      at PluginManager.spawn (/home/derevandal/projetcs/serverless/node_modules/serverless/lib/classes/PluginManager.js:503:17)
      at AwsDeploy.<anonymous> (/home/derevandal/projetcs/serverless/node_modules/serverless/lib/plugins/aws/deploy/index.js:93:48)
  From previous event:
      at Object.deploy:deploy [as hook] (/home/derevandal/projetcs/serverless/node_modules/serverless/lib/plugins/aws/deploy/index.js:89:30)
      at /home/derevandal/projetcs/serverless/node_modules/serverless/lib/classes/PluginManager.js:483:55
  From previous event:
      at PluginManager.invoke (/home/derevandal/projetcs/serverless/node_modules/serverless/lib/classes/PluginManager.js:483:22)
      at /home/derevandal/projetcs/serverless/node_modules/serverless/lib/classes/PluginManager.js:518:24
  From previous event:
      at PluginManager.run (/home/derevandal/projetcs/serverless/node_modules/serverless/lib/classes/PluginManager.js:518:8)
      at /home/derevandal/projetcs/serverless/node_modules/serverless/lib/Serverless.js:133:33
  From previous event:
      at Serverless.run (/home/derevandal/projetcs/serverless/node_modules/serverless/lib/Serverless.js:120:74)
      at /home/derevandal/projetcs/serverless/node_modules/serverless/scripts/serverless.js:54:26
      at processImmediate (internal/timers.js:456:21)
  From previous event:
      at Object.<anonymous> (/home/derevandal/projetcs/serverless/node_modules/serverless/scripts/serverless.js:54:4)
      at Module._compile (internal/modules/cjs/loader.js:1137:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
      at Module.load (internal/modules/cjs/loader.js:985:32)
      at Function.Module._load (internal/modules/cjs/loader.js:878:14)
      at Module.require (internal/modules/cjs/loader.js:1025:19)
      at require (internal/modules/cjs/helpers.js:72:18)
      at Object.<anonymous> (/home/derevandal/projetcs/serverless/node_modules/serverless/bin/serverless.js:41:1)
      at Module._compile (internal/modules/cjs/loader.js:1137:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
      at Module.load (internal/modules/cjs/loader.js:985:32)
      at Function.Module._load (internal/modules/cjs/loader.js:878:14)
      at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
      at internal/main/run_main_module.js:17:47

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information ---------------------------
     Operating System:          linux
     Node Version:              12.18.3
     Framework Version:         1.76.1
     Plugin Version:            3.6.17
     SDK Version:               2.3.1
     Components Version:        2.32.0

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

When I disable serverless-bundle, no error occurs.
I believe there may be a problem with the Webpack and / or TypeScript.

@lkhari
Copy link
Contributor

lkhari commented Jul 24, 2020

This is a bit of an assumption but in the logs you've posted, looking at these lines:

Serverless: Invoke webpack:package
Serverless: No external modules needed
Serverless: Packaging service...
Serverless: Invoke aws:package:finalize
Serverless: Invoke aws:common:moveArtifactsToPackage
Serverless: Invoke aws:common:validate
Serverless: Invoke aws:deploy:deploy

Surely this implies the error isn't to do with this library. Since you've manged to complete the packaging part of the process. It seems like the issue is more to do with the deployment part of the process, which could imply this is more of an issue to do with serverless-bundle.

@andrevandal
Copy link
Author

@lkhari

hmm, I understand. it makes sense ... I agree with you.
I’m going to look more at this build process.

Thank you very much for your attention ... if i have any updates on how i solved this, i will also post it here.

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

No branches or pull requests

3 participants