Skip to content

fix(build/js): Add subpath export shims for legacy bundlers#459

Merged
Lms24 merged 3 commits into
mainfrom
lms/fix-build-js-ewbpack-4-shims
Jul 1, 2026
Merged

fix(build/js): Add subpath export shims for legacy bundlers#459
Lms24 merged 3 commits into
mainfrom
lms/fix-build-js-ewbpack-4-shims

Conversation

@Lms24

@Lms24 Lms24 commented Jul 1, 2026

Copy link
Copy Markdown
Member

Currently, adding @sentry/conventions to code bases using legacy tooling (old TS versions or, as we found out, webpack 4), results in build failures. These old tools don't support the exports conditions field or the subpath exports inside of them. Therefore, they'd resolve an @sentry/conventions/attributes import to the file @sentry/coventions/attributes.js rather than the entry point declared in exports.

This PR adds the shim file so that the import resolves to the shim file, which in turn re-exports from the corresponding subpath export entry point file. We're pointing to CJS on purpose here, given the age of said legacy tools.

Why do we care? We need this for using the conventions package in our JS SDKs. We have a webpack 4 e2e test to ensure our SDK packages stay compatible with legacy setups, which failed after adding and importing from the current sentry conventions package. (getsentry/sentry-javascript#21855)

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


Bug Fixes 🐛

  • (build/js) Add subpath export shims for legacy bundlers by Lms24 in #459

🤖 This preview updates automatically when you update the PR.

@Lms24 Lms24 self-assigned this Jul 1, 2026
@Lms24 Lms24 marked this pull request as ready for review July 1, 2026 08:33
@Lms24 Lms24 requested review from a team, cleptric, mjq and nsdeschenes as code owners July 1, 2026 08:33
Comment thread javascript/sentry-conventions/attributes.d.ts Outdated
@Lms24 Lms24 merged commit 223ae0b into main Jul 1, 2026
17 checks passed
@Lms24 Lms24 deleted the lms/fix-build-js-ewbpack-4-shims branch July 1, 2026 10:29
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.

4 participants