Skip to content

fix(aws): Resolve all Sentry packages to local versions in layer build #17106

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

Merged
merged 2 commits into from
Jul 21, 2025

Conversation

msonnb
Copy link
Member

@msonnb msonnb commented Jul 21, 2025

This fixes the AWS Layer release build which tried to fetch the new package versions from the NPM registry, which don't exist yet during the build. We now build a new package.json that uses resolutions to point all Sentry packages to their local version.

@msonnb msonnb requested a review from andreiborza July 21, 2025 11:02
@msonnb msonnb self-assigned this Jul 21, 2025
@msonnb msonnb requested review from a team as code owners July 21, 2025 11:02
@msonnb msonnb force-pushed the ms/aws-layer-fix branch from 42e8c7f to f22f3ea Compare July 21, 2025 11:03
Copy link
Contributor

github-actions bot commented Jul 21, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.75 kB added added
@sentry/browser - with treeshaking flags 22.33 kB added added
@sentry/browser (incl. Tracing) 39.6 kB added added
@sentry/browser (incl. Tracing, Replay) 77.77 kB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 67.58 kB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 82.47 kB added added
@sentry/browser (incl. Tracing, Replay, Feedback) 94.57 kB added added
@sentry/browser (incl. Feedback) 40.44 kB added added
@sentry/browser (incl. sendFeedback) 28.42 kB added added
@sentry/browser (incl. FeedbackAsync) 33.33 kB added added
@sentry/react 25.49 kB added added
@sentry/react (incl. Tracing) 41.58 kB added added
@sentry/vue 28.18 kB added added
@sentry/vue (incl. Tracing) 41.4 kB added added
@sentry/svelte 23.77 kB added added
CDN Bundle 25.16 kB added added
CDN Bundle (incl. Tracing) 39.4 kB added added
CDN Bundle (incl. Tracing, Replay) 75.4 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 80.88 kB added added
CDN Bundle - uncompressed 73.42 kB added added
CDN Bundle (incl. Tracing) - uncompressed 116.83 kB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 230.97 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 243.78 kB added added
@sentry/nextjs (client) 43.61 kB added added
@sentry/sveltekit (client) 40.03 kB added added
@sentry/node-core 47.23 kB added added
@sentry/node 143.81 kB added added
@sentry/node - without tracing 91.31 kB added added
@sentry/aws-serverless 102.74 kB added added

@msonnb msonnb force-pushed the ms/aws-layer-fix branch from f22f3ea to d4c4a08 Compare July 21, 2025 11:11
cursor[bot]

This comment was marked as outdated.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Incorrect Path Resolution in `buildPackageJson`

The packagesDir path in the buildPackageJson function is incorrectly resolved. path.resolve(__dirname, '..') points to packages/aws-serverless, but it should point to the monorepo's root packages directory to scan all Sentry packages for resolutions. The correct path is path.resolve(__dirname, '../..').

packages/aws-serverless/scripts/buildLambdaLayer.ts#L144-L145

console.log('Building package.json');
const packagesDir = path.resolve(__dirname, '..');

Fix in CursorFix in Web


Bug: Incorrect Path in Lambda Layer Package.json

The package.json generated for the AWS Lambda layer at ./build/aws/dist-serverless/nodejs/package.json contains an incorrect relative path in its resolutions field. The path file:../../../../../../packages/${packageDir} is one level too deep and includes a redundant packages/ segment. The correct path should be file:../../../../../${packageDir} to properly reference local packages, otherwise, yarn resolutions will point to incorrect locations.

packages/aws-serverless/scripts/buildLambdaLayer.ts#L161-L162

if (typeof packageName === 'string' && packageName) {
resolutions[packageName] = `file:../../../../../../packages/${packageDir}`;

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

@msonnb msonnb merged commit 74d4566 into develop Jul 21, 2025
38 checks passed
@msonnb msonnb deleted the ms/aws-layer-fix branch July 21, 2025 11:57
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.

2 participants