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

serverless-plugin-typescript #27

Open
3boysdad opened this issue Feb 6, 2019 · 3 comments
Open

serverless-plugin-typescript #27

3boysdad opened this issue Feb 6, 2019 · 3 comments

Comments

@3boysdad
Copy link

3boysdad commented Feb 6, 2019

I haven't completely narrowed down the problem, but I've noticed that when using serverless-plugin-typescript, this plugin will not include any necessary dependencies. for instance...here's my package.json file

{
"devDependencies": {
"@3boysdad/serverless-plugin-typescript": "^1.2.0",
"@types/aws-sdk": "^2.7.0",
"@types/lodash": "^4.14.120",
"@types/node": "^10.12.21",
"@types/nodemailer": "^4.6.5",
"aws-sdk": "^2.395.0",
"serverless-offline": "^4.2.1",
"serverless-plugin-include-dependencies": "^3.2.1"
},
"dependencies": {
"axios": "^0.18.0",
"js-base64": "^2.5.1",
"lodash": "^4.17.11",
"md5": "^2.2.1",
"nodemailer": "^5.1.1",
"regex": "^0.1.1"
}
}

I need modules like nodemailer, md5, js-base64 included. in a pure javascript solution this doesn't seem to an issue - I can can plainly see that these appear in the node_modules directory in my lambda function. But when using typescript none of the libraries are included. A workaround is to include what I need, and hope I got them all or simply include everything and defeat the purpose of this wonderful plugin. Thoughts/suggestions/anyone else run into this?

@3boysdad
Copy link
Author

3boysdad commented Feb 8, 2019

here's a follow-up to this. i had to make some updates to some old, on workstation that haven't changed any of includes. i uploaded the changes and nothing worked. went to go look and the node_modules directory wasn't present. this was in a plan javascript project. still doing some research, but i can't think of a good reason this would just stop working all of a sudden.

@3boysdad
Copy link
Author

so i tried a simple case...https://github.com/3boysdad/TestServerless the handler will throw an exception when attempting to load. i must be missing obvious/stupid here. as i know this has worked for me in the past.

@dougmoscrop
Copy link
Owner

That simple example should certainly load; you can try running eslint . on your source and also node index.js just to see how it loads locally to rule out any possible typos and so on

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

2 participants