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

TypeError: Cannot read property 'hasOwnProperty' of undefined at serverlessS3Sync.sync #90

Open
DBankx opened this issue Sep 21, 2021 · 2 comments

Comments

@DBankx
Copy link

DBankx commented Sep 21, 2021

Hi, i am trying to deploy my react app frontend application using serverless and the serverlessS3Sync plugin and upon running the command sls deploy -v, everything works fine up until the end and it throws the error

Type Error ---------------------------------------------- TypeError: Cannot read property 'hasOwnProperty' of undefined at ServerlessS3Sync.sync (/Users/dami/dev/capitack/capitack-main-frontend/node_modules/serverless-s3-sync/index.js:112:15) at ServerlessS3Sync.tryCatcher (/Users/dami/dev/capitack/capitack-main-frontend/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/Users/dami/dev/capitack/capitack-main-frontend/node_modules/bluebird/js/release/promise.js:547:31) at Promise._settlePromise (/Users/dami/dev/capitack/capitack-main-frontend/node_modules/bluebird/js/release/promise.js:604:18) at Promise._settlePromiseCtx (/Users/dami/dev/capitack/capitack-main-frontend/node_modules/bluebird/js/release/promise.js:641:10) at _drainQueueStep (/Users/dami/dev/capitack/capitack-main-frontend/node_modules/bluebird/js/release/async.js:97:12) at _drainQueue (/Users/dami/dev/capitack/capitack-main-frontend/node_modules/bluebird/js/release/async.js:86:9) at Async._drainQueues (/Users/dami/dev/capitack/capitack-main-frontend/node_modules/bluebird/js/release/async.js:102:5) at Immediate.Async.drainQueues [as _onImmediate] (/Users/dami/dev/capitack/capitack-main-frontend/node_modules/bluebird/js/release/async.js:15:14) at processImmediate (internal/timers.js:462:21)

I have checked the plugin files in the node_modules folder and the issue is origination from these lines:
sync() { let s3Sync = this.serverless.service.custom.s3Sync; if(s3Sync.hasOwnProperty('buckets')) { s3Sync = s3Sync.buckets; } .......

Please is there any fix for this? please i need this ASAP as i am tasked with deploying the company's frontend on aws. Thanks and i await your responses!

@sreerammeka
Copy link

@DBankx I'm also facing a similar issue. Are you able to resolve this issue?

@marc-axonista
Copy link

marc-axonista commented Jul 21, 2022

@sreerammeka Be sure to have a s3Sync section under the custom section and note the capital "S" in s3Sync.

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

3 participants