Open mattmeye opened 5 years ago
Hi there! I'm getting the following error during deployment:
Type Error ---------------------------------------------
Cannot read property 'types' of undefined
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com
Your Environment Information -----------------------------
OS: darwin
Node Version: 9.10.1
Serverless Version: 1.39.1
serverless.yml
custom:
apigwBinary:
types:
- 'image/png'
I'd really love you to take a look at possible solution.
Highly appreciated!
I've found the problem and it's not related to the library. My case can be closed since my problem relative to our deployer that doesn't apply any custom settings from serverless.yml.
Need help. I get the following error during the serverless deploy.
Type Error ---------------------------------------------
Cannot read property 'match' of undefined
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
Stack Trace --------------------------------------------
TypeError: Cannot read property 'match' of undefined
at provider.request.then.resp (D:\MyPgGuru\serverless-image-rendering\node_modules\serverless-apigw-binary\src\index.js:19:30)
From previous event:
at resolve (D:\MyPgGuru\serverless-image-rendering\node_modules\serverless-apigw-binary\src\index.js:15:122)
at new Promise (
service: serverless-image-rendering custom: apigwBinary: types:
I resolved this by installing the package into npm
npm install serverless-apigw-binary
also may complain about the run time of nodejs6.10
@InkFaust could you let me know how you solved this problem in your case? I'm running into the same issue. (@Bookrage001's suggestion above of installing the package using npm doesn't solve it for me unfortunately.)
Thanks
Just as @joefhall this problem persists even after following @Bookrage001's suggestion
Same this problem persists even after following @Bookrage001's suggestion
I faced this issue and i just realized that i've accidentally removed api gateway trigger from my serverless.yml. After re-adding api gateway trigger (functions/events/http), It works just like before.
As dumb as this probably sounds, I was able to fix this by removing serverless-apigw-binary
from my serverless.yml
and dependencies. Turns out if you no longer have a lambda function that needs to serve binary files, there's no reason to have this package installed :)
Some libraries need to reinstall before deploy, try to add pre and post prefix and remove node_modules and reinstall with s3 operational system and node version, something like that:
"predeploy:hlg": "rm -rf node_modules && rm -rf package-lock.json && npm install --plataform linux --arch=x64 --target=12.21.0",
"deploy:hlg": "sls deploy,
"postdeploy:hlg": "rm -rf node_modules && npm install"
Obs: Verify if aws-multipart-parser a dependency, not a devdependencies, this can accuse an error too
Since v1.42 the serverless framework supports binary media type responses, so serverless-apigw-binary
is no longer necessary (https://www.serverless.com/blog/framework-release-v142)
provider:
apiGateway:
binaryMediaTypes:
- '*/*'
Since v1.42 the serverless framework supports binary media type responses, so
serverless-apigw-binary
is no longer necessary (https://www.serverless.com/blog/framework-release-v142)provider: apiGateway: binaryMediaTypes: - '*/*'
Only thing here is make sure to mind the indent under apiGateway:
provider:
apiGateway:
binaryMediaTypes:
- '*/*'
hello, i get the following error during sls deploy:
serverless.yml