-
Notifications
You must be signed in to change notification settings - Fork 41
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
Not adding dependency #43
Comments
I have a project that's using the |
@KundK I'm facing the same issue. Have you found the solution? |
@92nishant I have, but can't remember exactly what was it. And I don't have access to that code anymore. Sorry! |
@92nishant you may try adding something similar in your handler. This fixed it for me: // DO NOT REMOVE.
// serverless include dependencies plugin removes mysql2 required by knex
// this is added to ensure this dependency is included
// eslint-disable-next-line no-unused-vars
const mysql2 = require('mysql2'); |
Hi,
I have a strange case.
In my package.json I have:
"dependencies": { "mysql2": "^1.6.4", "sequelize": "^4.41.2" },
When I run "npm list" before "sls deploy" I get this:
[email protected] /opt/atlassian/pipelines/agent/build +-- [email protected] | +-- [email protected] | +-- [email protected] | |
-- [email protected]| +-- [email protected]
| |
-- [email protected] | +-- [email protected] | +-- [email protected] | |
-- [email protected]| +-- [email protected]
| |
-- [email protected] | | +-- [email protected] | |
-- [email protected]| +-- [email protected]
|
-- [email protected] +-- [email protected] | +-- [email protected] | +-- [email protected] | | +-- [email protected] | |
-- [email protected]| +-- [email protected]
| |
-- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | |
-- [email protected] deduped| +-- [email protected]
| | +-- [email protected] deduped
| |
-- [email protected] | |
-- [email protected]| +-- [email protected]
| +-- [email protected]
| | +-- @types/[email protected]
| |
-- [email protected] | |
-- @types/[email protected] deduped| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
|
-- [email protected] |
-- @types/[email protected]-- [email protected] +-- [email protected] . . .
But when the package deployed it doesn't have the mysql2 module.
I've tried to add
custom: includeDependencies: always: - 'node_modules/mysql2/**'
to serverless.yaml, but then I've got the following error while building the package:
Error: [serverless-plugin-include-dependencies]: Could not find cardinal at handle (/opt/atlassian/pipelines/agent/build/node_modules/serverless-plugin-include-dependencies/get-dependency-list.js:52:17)
Seems like mysql2 has an optional dependency of cardinal and that's causing the issue at the second time. Maybe it's the reason why it isn't included automatically.
Could you help me figuring this out?
The text was updated successfully, but these errors were encountered: