Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.

TypeError: arn.replace is not a function #48

Closed
eballetbaz opened this issue Aug 28, 2020 · 5 comments
Closed

TypeError: arn.replace is not a function #48

eballetbaz opened this issue Aug 28, 2020 · 5 comments
Assignees
Labels
bug Something isn't working fixed investigating

Comments

@eballetbaz
Copy link

When using serverless core layers feature in combinaision with this plugin a "TypeError: arn.replace is not a function" is thrown by logArn() function

Sample configuration:

Pre-build layer

layers:
postgresqlDriver:
package:
artifact: layer-linux-postgresql-driver.zip

Plugin configuration

custom:

AWS layers for Python requirements

serverless-layers:
# Commons for all lambdas
- common:
compileDir: .serverless/layers/common
dependenciesPath: src/layers/common/requirements.txt
# Per function requirements
- tool:
compileDir: .serverless/layers/tool
functions:
- items_get
dependenciesPath: src/layers/tool/requirements.txt

Function with prebuilt layer + "serverless-layers" plugin layers

functions:
items_get:
handler: src/v1/items/get/get.get
layers:
- { Ref: PostgresqlDriverLambdaLayer }

Error:

TypeError: arn.replace is not a function
at ServerlessLayers.logArn (C:\Graphane\serverless\api-mds-private\node_modules\serverless-layers\lib\index.js:779:18)
at forEach (C:\Graphane\serverless\api-mds-private\node_modules\serverless-layers\src\index.js:406:76)
at Array.forEach ()
at forEach (C:\Graphane\serverless\api-mds-private\node_modules\serverless-layers\src\index.js:401:14)
at Array.forEach ()
at ServerlessLayers._callee7$ (C:\Graphane\serverless\api-mds-private\node_modules\serverless-layers\src\index.js:392:41)
at tryCatch (C:\Graphane\serverless\api-mds-private\node_modules\regenerator-runtime\runtime.js:63:40)
at Generator.invoke [as _invoke] (C:\Graphane\serverless\api-mds-private\node_modules\regenerator-runtime\runtime.js:293:22)
at Generator.next (C:\Graphane\serverless\api-mds-private\node_modules\regenerator-runtime\runtime.js:118:21)
at asyncGeneratorStep (C:\Graphane\serverless\api-mds-private\node_modules@babel\runtime\helpers\asyncToGenerator.js:3:24)
at _next (C:\Graphane\serverless\api-mds-private\node_modules@babel\runtime\helpers\asyncToGenerator.js:25:9)
at C:\Graphane\serverless\api-mds-private\node_modules@babel\runtime\helpers\asyncToGenerator.js:32:7
at new Promise ()
at ServerlessLayers. (C:\Graphane\serverless\api-mds-private\node_modules@babel\runtime\helpers\asyncToGenerator.js:21:12)
at ServerlessLayers.finalizeDeploy (C:\Graphane\serverless\api-mds-private\node_modules\serverless-layers\lib\index.js:735:32)
at ServerlessLayers. (C:\Graphane\serverless\api-mds-private\node_modules\serverless-layers\src\index.js:34:26)
at ServerlessLayers.tryCatcher (C:\Graphane\serverless\api-mds-private\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (C:\Graphane\serverless\api-mds-private\node_modules\bluebird\js\release\promise.js:547:31)
at Promise._settlePromise (C:\Graphane\serverless\api-mds-private\node_modules\bluebird\js\release\promise.js:604:18)
at Promise._settlePromise0 (C:\Graphane\serverless\api-mds-private\node_modules\bluebird\js\release\promise.js:649:10)
at Promise._settlePromises (C:\Graphane\serverless\api-mds-private\node_modules\bluebird\js\release\promise.js:729:18)
at _drainQueueStep (C:\Graphane\serverless\api-mds-private\node_modules\bluebird\js\release\async.js:93:12)
at _drainQueue (C:\Graphane\serverless\api-mds-private\node_modules\bluebird\js\release\async.js:86:9)
at Async._drainQueues (C:\Graphane\serverless\api-mds-private\node_modules\bluebird\js\release\async.js:102:5)
at Immediate.Async.drainQueues (C:\Graphane\serverless\api-mds-private\node_modules\bluebird\js\release\async.js:15:14)
at processImmediate (internal/timers.js:456:21)

@agutoli agutoli self-assigned this Sep 13, 2020
@agutoli agutoli added bug Something isn't working investigating labels Sep 13, 2020
eballetbaz pushed a commit to eballetbaz/serverless-layers that referenced this issue Sep 15, 2020
@enricodeleo
Copy link

Same issue here

@eballetbaz
Copy link
Author

@agutoli : please let me know if something is missing you in order to merge my pull request
Thanks

@rashid301
Copy link

I am having this issue too. Because of this, my CI process complains that deployment failed. My serverless file looks like this.

functions:
  report:
    handler: src/report.exec
    layers:
      - { Ref: MyLayerLambdaLayer }
    events:
      - http:
          path: /report
          method: get
layers:
  myLayer:
    package:
      artifact: layers/layer.zip

@agutoli
Copy link
Owner

agutoli commented Dec 2, 2020

Hello, guys! Please try version 2.3.3.

Screen Shot 2020-12-03 at 12 39 15 am

thanks to @eballetbaz for all help.

@agutoli agutoli added the fixed label Dec 2, 2020
@agutoli
Copy link
Owner

agutoli commented Dec 2, 2020

I gonna close this issue for now (we can re-open if necessary).

@agutoli agutoli closed this as completed Dec 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working fixed investigating
Projects
None yet
Development

No branches or pull requests

4 participants