s3sync broken with Serverless Framework v4
Serverless Framework is now v4. This awesome plugin stopped working.
Reproduce by updating Serverless Framework:
npm i -g [email protected]
Run s3sync.
✖ Cannot read properties of undefined (reading 'remove')
TypeError: Cannot read properties of undefined (reading 'remove')
at C:\workspace\ab-test-demo\node_modules\serverless-s3-sync\index.js:302:22
at <anonymous>
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
For help, try the following:
• Run the command again with the "--debug" option
• Run "serverless support"
• Review the docs: https://www.serverless.com/framework/docs/
What about latest version 3?
$ npm i -g [email protected]
$ sls s3sync
Running "serverless" from node_modules
✔ Synced files to S3 buckets
✔ Synced bucket metadata
✔ Updated bucket tags
Works fine.
The docs said v4 is backwards compatible. Maybe there's a change in the plugin integration.
Seconded. Getting the exact same error since upgrading serverless to v4.
Third, i also got the same error after updating to V4. It looks like the error is in the task progress handler but i'm not sure how that was adjusted or changed with the V4 changes. I'd almost ask the question do we need that? Can we just print a starting log and a finish log and remove that all together?
It looks like the issue has already has been fixed and might have been related to https://github.com/serverless/serverless/issues/12509
I Also provided a PR to get this plugin working along Serverless v4 without NPM complaining about peer dependencies. https://github.com/k1LoW/serverless-s3-sync/pull/135
@dgoerdes were you able to resolve dependency issue with serverless v4?
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: [email protected]
npm error Found: [email protected]
npm error node_modules/serverless
npm error dev serverless@"^4.4.7" from the root project
npm error
npm error Could not resolve dependency:
npm error peer serverless@"^3.0.0" from [email protected]
npm error node_modules/serverless-s3-sync
npm error dev serverless-s3-sync@"^3.3.0" from the root project
npm error
npm error Conflicting peer dependency: [email protected]
npm error node_modules/serverless
npm error peer serverless@"^3.0.0" from [email protected]
npm error node_modules/serverless-s3-sync
npm error dev serverless-s3-sync@"^3.3.0" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
I had to do --legacy-peer-deps, but this is causing me issues here and there
@dgoerdes were you able to resolve dependency issue with serverless v4?
That should be solved with the PR #135 I mentioned above. @k1LoW Could you have a look and merge it in please?
This is working as expected for me in Serverless v4. Thanks for fixing.