Skip to content

(aws-s3): synth fails with Yarn PnP when autoDeleteObjects is enabled #16552

@asterikx

Description

@asterikx

When autoDeleteObjects is set to true, yarn cdk synth fails when using yarn with PnP. When set to false (or omitted), yarn cdk synth succeeds.

Reproduction Steps

const bucket = new s3.Bucket(this, 'MyBucket', {
  removalPolicy: cdk.RemovalPolicy.DESTROY,
  autoDeleteObjects: true, // <-- this line causes synth to fail
});

What did you expect to happen?

yarn cdk synth succeeds regardless of whether autoDeleteObjects is enabled or not.

What actually happened?

yarn cdk synth fails if autoDeleteObjects is enabled:

MYUSER@MyHost some-project % yarn synth
/Users/MYUSER/some-project/.pnp.cjs:64081
  return Object.assign(new Error(`${code}: ${message}`), {
                       ^
Error: EROFS: read-only filesystem, open '/node_modules/@aws-cdk/aws-s3/lib/auto-delete-objects-handler/__entrypoint__.js'
    at makeError (/Users/MYUSER/some-project/.pnp.cjs:64081:24)
    at EROFS (/Users/MYUSER/some-project/.pnp.cjs:64111:10)
    at ZipFS.prepareWriteFile (/Users/MYUSER/some-project/.pnp.cjs:66420:30)
    at ZipFS.writeFileSync (/Users/MYUSER/some-project/.pnp.cjs:66408:14)
    at fallback (/Users/MYUSER/some-project/.pnp.cjs:67250:14)
    at /Users/MYUSER/some-project/.pnp.cjs:67270:18
    at /Users/MYUSER/some-project/.pnp.cjs:67584:58
    at ZipOpenFS.getZipSync (/Users/MYUSER/some-project/.pnp.cjs:67729:14)
    at ZipOpenFS.makeCallSync (/Users/MYUSER/some-project/.pnp.cjs:67584:17)
    at /Users/MYUSER/some-project/.pnp.cjs:67264:19
Subprocess exited with error 1

Environment

  • CDK CLI Version : 1.123.0 (build fad855e)
  • Framework Version: 1.123.0
  • Node.js Version: v14.17.6
  • OS : macOS 11.6
  • Language (Version): TypeScript (4.4.3)

This is 🐛 Bug Report

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions