Skip to content

Conversation

@cgatt
Copy link

@cgatt cgatt commented Apr 30, 2025

Fixes #258

This issue is caused by the behaviour of AssetStaging.relativeStagedPath(), which normally returns a path relative to the stack's outdir, but can return an absolute path when staging or bundling is skipped, or when the asset is staged outside of the outdir.
See the docstring on relativeStagedPath:
https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/core/lib/asset-staging.ts#L266-L269
And the 'skip' behaviour in stageByBundling
https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/core/lib/asset-staging.ts#L310-L325

A test has been added that can be used to demonstrate the issue and shows that it is now resolved.

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

Successfully merging this pull request may close these issues.

Cannot find asset with NodejsFunction created asset

1 participant