Repository navigation
fix(esbuild): Avoid import-is-undefined warning for entries without a default export - #26132
Merged
Merged
Conversation
… default export The debug ID proxy re-exports the entry's default export statically so downstream bundlers can tree-shake it, but esbuild warns about that access when the entry point has no default export. Silence the warning through esbuild's logOverride, keeping any override the user sets themselves. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
size-limit report 📦Compared: 75ed89f (PR test merge using develop at c054e7a) Against: c054e7a (develop) · base run #65086 ✅ Baseline matches: this diff contains only this PR's changes.
|
Member
Author
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 019b489. Configure here.
Contributor
Optional E2E testsSome optional checks were not successful. They do not block the merge. 5 not successful, 40 successful. See the run.
Successful checks
|
chargome
marked this pull request as ready for review
November 5, 2026 13:46
chargome
requested review from
Lms24,
andreiborza,
logaretm,
mydea and
s1gr1d
and removed request for
a team
November 5, 2026 13:46
andreiborza
approved these changes
Nov 5, 2026
43081j
pushed a commit
to 43081j/sentry-javascript
that referenced
this pull request
Nov 9, 2026
… default export (getsentry#26132) **Why:** The debug ID proxy statically re-exports the entry's default export so downstream bundlers can tree-shake, which makes esbuild warn with `import-is-undefined` whenever an entry has no default export. esbuild can't suppress a diagnostic per file, so the plugin sets `logOverride['import-is-undefined'] = 'silent'` in `initialOptions`, same as it already forces `metafile`. The proxy's path, suffix and namespace stay as they are, so other plugins, source maps and the metafile are unaffected. Tradeoff: this silences the warning for the whole build. A user-provided `logOverride` for that id wins, so it can be turned back on. Supersedes getsentry#26123, which relied on an undocumented esbuild heuristic and changed the proxy's namespace and path in ways other plugins observe. **How to review:** Four lines in `packages/bundler-plugins/src/esbuild/index.ts`, plus `test/esbuild/entry-without-default-export.test.ts`. Closes getsentry#25885 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
51 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why: The debug ID proxy statically re-exports the entry's default export so downstream bundlers can tree-shake, which makes esbuild warn with
import-is-undefinedwhenever an entry has no default export. esbuild can't suppress a diagnostic per file, so the plugin setslogOverride['import-is-undefined'] = 'silent'ininitialOptions, same as it already forcesmetafile. The proxy's path, suffix and namespace stay as they are, so other plugins, source maps and the metafile are unaffected.Tradeoff: this silences the warning for the whole build. A user-provided
logOverridefor that id wins, so it can be turned back on.Supersedes #26123, which relied on an undocumented esbuild heuristic and changed the proxy's namespace and path in ways other plugins observe.
How to review: Four lines in
packages/bundler-plugins/src/esbuild/index.ts, plustest/esbuild/entry-without-default-export.test.ts.Closes #25885
🤖 Generated with Claude Code