serverless / serverless-plugin-typescript

Serverless plugin for zero-config Typescript support
MIT License
784 stars 222 forks source link

Configuration files with .json extension might be copied before sent it to s3. #35

Open brq-cr opened 7 years ago

brq-cr commented 7 years ago

.key (googleCloud) or .json config files might be copied after compile code process. Otherwise Lambda returns a module error b/c file isn't there.

Use example -------

const visionApi = googleVision({ projectId: 'awesome-project-168122', keyFilename: './my-service-accout.json', }); Error example -----------

Unable to import module 'handler': Error at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object. (/var/task/node_modules/grpc/src/node/src/grpc_extension.js:30:15) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3)

brq-cr commented 7 years ago

My bad the issue described above is related to google vision library. But it still being a good idea copy those .json files to allow configuration files.

I fixed it temporally using this solution here: https://stackoverflow.com/questions/40032758/aws-lambda-w-google-vision-api-throwing-pem-read-biono-start-line-or-errnoen