You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the call stack when this exception occurs:
Interactively debugging shows that the codepath is trying to copy files within the node_modules directory, which PnP explicitly denies:
Even in the npm / node_modules world, the node_modules directory should likely be treated as read-only to prevent issues between runs.
Reproduction Steps
This stack exposes the problem:
import*ascloudfrontfrom"aws-cdk-lib/aws-cloudfront";import*asoriginsfrom"aws-cdk-lib/aws-cloudfront-origins";import*aslambdafrom"aws-cdk-lib/aws-lambda";import*ass3from"aws-cdk-lib/aws-s3";import*ascdkfrom"aws-cdk-lib";import{join}from"path";import{Construct}from"constructs";exportclassCdkBugReportsStackextendscdk.Stack{constructor(scope: Construct,id: string,props?: cdk.StackProps){super(scope,id,{env: {region: 'us-west-2',// This region must be non us-east-1 to show the problem},
...props});constbucket=news3.Bucket(this,"HostingBucket");constrootRedirectEdgeFunction=newcloudfront.experimental.EdgeFunction(this,"RootRedirectEdgeFunction",{runtime: lambda.Runtime.NODEJS_14_X,handler: "root-redirect.handler",code: lambda.Code.fromAsset(join(__dirname,"lambda-at-edge")),});newcloudfront.Distribution(this,"SiteDistribution",{defaultBehavior: {origin: neworigins.S3Origin(bucket),edgeLambdas: [{eventType: cloudfront.LambdaEdgeEventType.VIEWER_REQUEST,functionVersion: rootRedirectEdgeFunction.currentVersion,},],},});}}
Clone the repo locally git clone -b bug/cloudfront-experimental-with-yarn https://github.com/blimmer/cdk-bug-reports.git
cd cdk-bug-reports
yarn install
yarn cdk synth
What did you expect to happen?
I expected the synth to work without erroring.
What actually happened?
I encounter this error
> yarn cdk synth
/Users/blimmer/code/cdk-bug-reports/.pnp.cjs:6683
return Object.assign(new Error(`${code}: ${message}`), {code});
^
Error: EROFS: read-only filesystem, copyfile '/node_modules/aws-cdk-lib/core/lib/custom-resource-provider/nodejs-entrypoint.js -> '/node_modules/aws-cdk-lib/aws-cloudfront/lib/experimental/edge-function/__entrypoint__.js'
at makeError$1 (/Users/blimmer/code/cdk-bug-reports/.pnp.cjs:6683:24)
at EROFS (/Users/blimmer/code/cdk-bug-reports/.pnp.cjs:6710:10)
at ZipFS.prepareCopyFile (/Users/blimmer/code/cdk-bug-reports/.pnp.cjs:8419:13)
at ZipFS.copyFileSync (/Users/blimmer/code/cdk-bug-reports/.pnp.cjs:8410:58)
at /Users/blimmer/code/cdk-bug-reports/.pnp.cjs:9496:25
at /Users/blimmer/code/cdk-bug-reports/.pnp.cjs:9724:60
at ZipOpenFS.getZipSync (/Users/blimmer/code/cdk-bug-reports/.pnp.cjs:9853:14)
at ZipOpenFS.makeCallSync (/Users/blimmer/code/cdk-bug-reports/.pnp.cjs:9724:17)
at /Users/blimmer/code/cdk-bug-reports/.pnp.cjs:9490:19
at /Users/blimmer/code/cdk-bug-reports/.pnp.cjs:9724:60 {
code: 'EROFS'
}
Subprocess exited with error 1
If I switch the nodeLinker to node-modules, this starts working. However, as mentioned above, we should probably treat the node_modules directory as read-only, as well.
The text was updated successfully, but these errors were encountered:
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
What is the problem?
I'm encountering an error when using Yarn Berry (3.2.0) and the default Plug n' Play linker.
This is the call stack when this exception occurs:
Interactively debugging shows that the codepath is trying to copy files within the
node_modules
directory, which PnP explicitly denies:Even in the
npm
/node_modules
world, thenode_modules
directory should likely be treated as read-only to prevent issues between runs.Reproduction Steps
This stack exposes the problem:
You can see this issue in my sample repository as well. See blimmer/cdk-bug-reports#1 and https://github.com/blimmer/cdk-bug-reports/runs/5591132734?check_suite_focus=true for the failed synth.
git clone -b bug/cloudfront-experimental-with-yarn https://github.com/blimmer/cdk-bug-reports.git
cd cdk-bug-reports
yarn install
yarn cdk synth
What did you expect to happen?
I expected the synth to work without erroring.
What actually happened?
I encounter this error
CDK CLI Version
2.17.0 (build f9cd009)
Framework Version
2.17.0
Node.js Version
16.14.0
OS
macOS 12.3
Language
Typescript
Language Version
TypeScript (3.9.10) | Yarn (3.2.0)
Other information
If I switch the
nodeLinker
tonode-modules
, this starts working. However, as mentioned above, we should probably treat thenode_modules
directory as read-only, as well.The text was updated successfully, but these errors were encountered: