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

❗ NOTICE (core): Stack crossRegionReferences and CfnJson fail with Error: Cannot find module '../dist/core/<file>.generated' #28465

Closed
mrgrain opened this issue Dec 22, 2023 · 4 comments · Fixed by #28467
Labels
@aws-cdk/core Related to core CDK functionality @aws-cdk/custom-resources Related to AWS CDK Custom Resources management/tracking Issues that track a subject or multiple issues p0

Comments

@mrgrain
Copy link
Contributor

mrgrain commented Dec 22, 2023

Status

COMPLETED

What is the issue?

Enabling the experimental crossRegionReferences on a Stack or using the core.CfnJson construct causes app synthesis to fail with Error: Cannot find module '../dist/core/<file>.generated' because the files are missing from the faulty release. If you are not using either of the two features, you will not be affected by this.

Error message

Error: Cannot find module '../dist/core/cfn-utils-provider.generated'

What is the impact?

Synth & deployment fails completely

Workaround

None.

Who is affected?

Everyone using CfnJson or has enabled the experimental crossRegionReferences on a Stack with v2.116.0

How do I resolve this?

Update to v2.116.1

Related issues

#28251 (comment)

@mrgrain mrgrain added management/tracking Issues that track a subject or multiple issues p0 labels Dec 22, 2023
@Geaper
Copy link

Geaper commented Dec 22, 2023

Also facing similar issues on 2.116.0...

> Error: Cannot find module '../../dist/core/cross-region-ssm-reader-provider.generated'
> Require stack:
> - /root/projects/project/cdk/node_modules/aws-cdk-lib/core/lib/custom-resource-provider/cross-region-export-providers/export-reader-provider.js
> - /root/projects/project/cdk/node_modules/aws-cdk-lib/core/lib/custom-resource-provider/cross-region-export-providers/export-writer-provider.js
> - /root/projects/project/cdk/node_modules/aws-cdk-lib/core/lib/private/refs.js
> - /root/projects/project/cdk/node_modules/aws-cdk-lib/core/lib/private/prepare-app.js
> - /root/projects/project/cdk/node_modules/aws-cdk-lib/core/lib/private/synthesis.js
> - /root/projects/project/cdk/node_modules/aws-cdk-lib/core/lib/stage.js
> - /root/projects/project/cdk/node_modules/aws-cdk-lib/core/lib/index.js
> - /root/projects/project/cdk/node_modules/aws-cdk-lib/core/index.js
> - /root/projects/project/cdk/node_modules/aws-cdk-lib/index.js

@mrgrain
Copy link
Contributor Author

mrgrain commented Dec 22, 2023

@Geaper Thanks for reporting!

@mrgrain mrgrain pinned this issue Dec 22, 2023
@mrgrain mrgrain changed the title ❗ NOTICE (core): CfnJson fails with Error: Cannot find module '../dist/core/cfn-utils-provider.generated' ❗ NOTICE (core): Core constructs fail with Error: Cannot find module '../dist/core/<file>,generated' Dec 22, 2023
@mrgrain mrgrain changed the title ❗ NOTICE (core): Core constructs fail with Error: Cannot find module '../dist/core/<file>,generated' ❗ NOTICE (core): Core constructs fail with Error: Cannot find module '../dist/core/<file>.generated' Dec 22, 2023
@mergify mergify bot closed this as completed in #28467 Dec 22, 2023
mergify bot pushed a commit that referenced this issue Dec 22, 2023
…ist/core/<file>.generated'` (#28467)

#28251 added new files to `aws-cdk-lib/core/lib/dist/core` but this path was excluded from the npm package, causing the above error.

This fix includes the generated file into the package.

Closes #28465

Manually tested with a locally build package that includes the fix.
<img width="1449" alt="image" src="https://github.com/aws/aws-cdk/assets/379814/11714c41-edea-403e-9b64-454ba9768c08">

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@mrgrain mrgrain reopened this Dec 22, 2023
@aws aws deleted a comment from github-actions bot Dec 22, 2023
mrgrain added a commit that referenced this issue Dec 22, 2023
…ist/core/<file>.generated'` (#28467)

#28251 added new files to `aws-cdk-lib/core/lib/dist/core` but this path was excluded from the npm package, causing the above error.

This fix includes the generated file into the package.

Closes #28465

Manually tested with a locally build package that includes the fix.
<img width="1449" alt="image" src="https://github.com/aws/aws-cdk/assets/379814/11714c41-edea-403e-9b64-454ba9768c08">

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@mrgrain
Copy link
Contributor Author

mrgrain commented Dec 22, 2023

Hotfix release is underway: #28468
ETA: 2023-22-12 18:00 UTC

@mrgrain mrgrain added @aws-cdk/core Related to core CDK functionality @aws-cdk/custom-resources Related to AWS CDK Custom Resources labels Dec 22, 2023
@mrgrain mrgrain changed the title ❗ NOTICE (core): Core constructs fail with Error: Cannot find module '../dist/core/<file>.generated' ❗ NOTICE (core): Setting StackProps.crossRegionReferences: true or using CfnJson fails with Error: Cannot find module '../dist/core/<file>.generated' Dec 22, 2023
mrgrain added a commit to cdklabs/aws-cdk-notices that referenced this issue Dec 22, 2023
mergify bot pushed a commit to cdklabs/aws-cdk-notices that referenced this issue Dec 22, 2023
@mrgrain mrgrain changed the title ❗ NOTICE (core): Setting StackProps.crossRegionReferences: true or using CfnJson fails with Error: Cannot find module '../dist/core/<file>.generated' ❗ NOTICE (core): Stack crossRegionReferences and CfnJson fail with Error: Cannot find module '../dist/core/<file>.generated' Dec 22, 2023
@mrgrain mrgrain closed this as completed Dec 22, 2023
@aws aws deleted a comment from github-actions bot Dec 22, 2023
@mrgrain
Copy link
Contributor Author

mrgrain commented Dec 22, 2023

Fix has been released: https://github.com/aws/aws-cdk/releases/tag/v2.116.1

paulhcsun pushed a commit to paulhcsun/aws-cdk that referenced this issue Jan 5, 2024
…ist/core/<file>.generated'` (aws#28467)

aws#28251 added new files to `aws-cdk-lib/core/lib/dist/core` but this path was excluded from the npm package, causing the above error.

This fix includes the generated file into the package.

Closes aws#28465

Manually tested with a locally build package that includes the fix.
<img width="1449" alt="image" src="https://github.com/aws/aws-cdk/assets/379814/11714c41-edea-403e-9b64-454ba9768c08">

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@rix0rrr rix0rrr unpinned this issue Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/core Related to core CDK functionality @aws-cdk/custom-resources Related to AWS CDK Custom Resources management/tracking Issues that track a subject or multiple issues p0
Projects
None yet
2 participants