Repository navigation
fix(wxt): explain missing globals when loading entrypoints - #2679
Open
appdever01 wants to merge 1 commit into
Open
appdever01 wants to merge 1 commit into
appdever01 wants to merge 1 commit into
Conversation
appdever01
requested review from
PatrykKuniczak,
aklinker1 and
nishu-murmu
as code owners
October 19, 2026 23:26
✅ Deploy Preview for creative-fairy-df92c4 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This branch has not been deployed
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.
Overview
When an entrypoint uses an unavailable browser global outside its main function, preparation and builds fail with a bare ReferenceError. Include the entrypoint path, explain the build-time Node.js environment and link the entrypoint loader documentation so the error points to a solution.
The original error and stack are retained as the cause. Unrelated failures, including other ReferenceErrors, are rethrown unchanged.
Manual Testing
Add
new MutationObserver(() => {});above a content script definition, then runwxt prepareor build. The error includes the entrypoint path, guidance to move browser API calls intomain, and the documentation link. Moving the browser call insidemainallows preparation and builds to succeed.Local validation on macOS:
bun run test run e2e/tests/entrypoint-errors.test.ts --maxWorkers=2frompackages/wxt: all nine cases pass. Five diagnostic cases fail against the original importer.main.Related Issue
This PR closes #1056