Skip to content

Conversation

@Lms24
Copy link
Member

@Lms24 Lms24 commented Apr 26, 2022

This PR fixes the AWS Lambda layer in @sentry/serverless.

The problem was caused by changes introduced in #4882.

Some unintended consequences of these changes were:

  • By centralising most .npmignore files, npm-packlist did not find all the necessary (but also unnecessary) files when creating the list of files that should end up in the lambda layer Zip file. Due to the missing .npmignore files, it resorted to .gitignore which ignores generated JS files. This PR re-adds local .npmignore files in the dependencies of @sentry/serverless to fix this.
  • @sentry/tracing is a special case where we need to execute prepack.ts also after building. The call to prepack was missing the --bundles flag, resulting in a weird directory structure. This PR adds the flag and adjusts the sideEffects entry we need for our integration tests.

As a hotfix, this PR ensures further that the directory structure in the Lambda layer conforms to the NODE_OPTIONS environment variable set by Sentry

Fixes #4949
ref: https://getsentry.atlassian.net/browse/INC-135
ref: https://getsentry.atlassian.net/browse/WEB-860

add .gitignores to let packlist know of files to keep
add missing --bundles flags to tracing yarn build command
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.

lambda layer > 60 seem to break with "Error: Cannot find module './async'"

4 participants