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

Compatible with layers? #48

Open
ianbale opened this issue Jan 21, 2020 · 5 comments
Open

Compatible with layers? #48

ianbale opened this issue Jan 21, 2020 · 5 comments

Comments

@ianbale
Copy link

ianbale commented Jan 21, 2020

Is this plugin compatible with lambda layers?

I'm trying to deploy a package that uses a layer and receiving this error message:

Path must be a string. Received null

Appears to be related to my include of the file in my layer:

const pkg = require('/opt/package1')

@ssanri
Copy link

ssanri commented May 6, 2020

similar issue as above. using layers and excluded in package, plugin still tries to find package in node_modules folder and breaks the deployment.

@developer-carsony
Copy link

const lambda_utils = require('/opt/node/lambda_utils.js')

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received null         
      at validateString (internal/validators.js:117:11)                 
        at Object.join (path.js:1039:7)
        at handle (/home/user/opsste/platform-logging-sls/runway/15-lambda-logging.sls/node_modules/serverless-plugin-include-dependencies/get-dependency-list.js:28:46)
        at /home/user/opsste/platform-logging-sls/runway/15-lambda-logging.sls/node_modules/serverless-plugin-include-dependencies/get-dependency-list.js:71:9
              at Array.forEach (<anonymous>)                                                                   
        at module.exports (/home/user/opsste/platform-logging-sls/runway/15-lambda-logging.sls/node_modules/serverless-plugin-include-dependencies/get-dependency-list.js:64:66)
        at IncludeDependencies.getDependencyList (/home/user/opsste/platform-logging-sls/runway/15-lambda-logging.sls/node_modules/serverless-plugin-include-dependencies/include-dependencies.js:152:12)
        at IncludeDependencies.getDependencies (/home/user/opsste/platform-logging-sls/runway/15-lambda-logging.sls/node_modules/serverless-plugin-include-dependencies/include-dependencies.js:139:31)
        at IncludeDependencies.processNodeFunction (/home/user/opsste/platform-logging-sls/runway/15-lambda-logging.sls/node_modules/serverless-plugin-include-dependencies/include-dependencies.js:112:33)
        at IncludeDependencies.processFunction (/home/user/opsste/platform-logging-sls/runway/15-lambda-logging.sls/node_modules/serverless-plugin-include-dependencies/include-dependencies.js:59:12)
        at /home/user/opsste/platform-logging-sls/runway/15-lambda-logging.sls/node_modules/serverless-plugin-include-dependencies/include-dependencies.js:41:14
              at Array.forEach (<anonymous>)                                                                   
        at IncludeDependencies.createDeploymentArtifacts (/home/user/opsste/platform-logging-sls/runway/15-lambda-logging.sls/node_modules/serverless-plugin-include-dependencies/include-dependencies.js:40:3
            8)                                             
              at /usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:490:55
                From previous event:                                                                                 
                      at PluginManager.invoke (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:490:22)
        at PluginManager.spawn (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:510:17)
        at Deploy.<anonymous> (/usr/local/lib/node_modules/serverless/lib/plugins/deploy/deploy.js:115:50)
    From previous event:
          at Object.before:deploy:deploy [as hook] (/usr/local/lib/node_modules/serverless/lib/plugins/deploy/deploy.js:100:30)
                at /usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:490:55
                  From previous event:                 
                        at PluginManager.invoke (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:490:22)
        at /usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:525:24
          From previous event:               
                at PluginManager.run (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:525:8)
        at /usr/local/lib/node_modules/serverless/lib/Serverless.js:133:33
          From previous event:                                                                                 
                at Serverless.run (/usr/local/lib/node_modules/serverless/lib/Serverless.js:120:74)`

@saulomano
Copy link

I have the same issuer with layer
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received null
at validateString (internal/validators.js:121:11)
at Object.join (path.js:1039:7)

@saulomano
Copy link

Is this plugin compatible with lambda layers?

I'm trying to deploy a package that uses a layer and receiving this error message:

Path must be a string. Received null

Appears to be related to my include of the file in my layer:

const pkg = require('/opt/package1')

I solved my problem using cont to define path

const sharedPath = env.LAYER_PATH || '/opt/nodejs/apiDashgo.js';

const dashgo = require(sharedPath);

@rooleek
Copy link

rooleek commented Nov 26, 2020

Has this ever been solved?
This module tries to import files from unexisting during deploy folders(layers folders).
how to solve that?

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

5 participants