Skip to content

Fix browser extension build resolving entries for a node target - #1772

Open
dualfroz wants to merge 1 commit into
MODSetter:mainfrom
dualfroz:fix-extension-build-target
Open

dualfroz wants to merge 1 commit into
MODSetter:mainfrom
dualfroz:fix-extension-build-target

Conversation

@dualfroz

@dualfroz dualfroz commented Sep 13, 2026

Copy link
Copy Markdown

With only engines.node in package.json, Parcel builds the extension for a node target and fails with Failed to resolve '../../popup.tsx'.
Declaring engines.browsers, Plasmo's own MV3 default, restores the browser target. Same error as #506, reproduced on Linux, not tested on Windows.

Refs #506

High-level PR Summary

This PR fixes a build issue where Parcel was incorrectly targeting Node.js instead of the browser environment for the browser extension. By adding an explicit engines.browsers field to the package.json, the build tool now correctly resolves the browser target and prevents module resolution failures.

⏱️ Estimated Review Time: 5-15 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_browser_extension/package.json

Need help? Join our Discord

Summary by CodeRabbit

  • Compatibility
    • Added support metadata targeting the latest Chrome version for the browser extension.

…ries

Parcel reads package.json engines and, seeing only engines.node, built the
extension for a node target instead of the browser target plasmo passes as
its default, which failed with "Failed to resolve '../../popup.tsx'".
Declaring engines.browsers restores plasmo's intended chrome-mv3 target.

Fixes MODSetter#506
@vercel

vercel Bot commented Sep 13, 2026

Copy link
Copy Markdown

@dualfroz is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: cf60d36e-ec1e-41df-9743-972f8d6e874f

📥 Commits

Reviewing files that changed from the base of the PR and between c139e19 and b2166f6.

📒 Files selected for processing (1)
  • surfsense_browser_extension/package.json

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The browser extension package metadata now declares support for the latest Chrome version.

Changes

Browser Compatibility

Layer / File(s) Summary
Chrome compatibility metadata
surfsense_browser_extension/package.json
Added a browsers engine constraint for the latest Chrome version.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Suggested reviewers: modsetter

Merge Risk: ⚪ Minimal · up to b2166

The extension metadata restores the intended browser target and entry resolution, with no concrete merge-blocking risk identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing browser extension build entry resolution caused by an incorrect Node target.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

⚠️ This pull request shows signs of AI-generated slop (ai_padded_prose). It has been flagged by CodeRabbit slop detection and should be reviewed carefully.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant