Skip to content

fix(app): guard modulepreload relList.supports for CEF#1050

Merged
M3gA-Mind merged 7 commits into
tinyhumansai:mainfrom
M3gA-Mind:update/release-files
Apr 30, 2026
Merged

fix(app): guard modulepreload relList.supports for CEF#1050
M3gA-Mind merged 7 commits into
tinyhumansai:mainfrom
M3gA-Mind:update/release-files

Conversation

@M3gA-Mind
Copy link
Copy Markdown
Contributor

@M3gA-Mind M3gA-Mind commented Apr 30, 2026

Summary

  • add a Vite post-render plugin that rewrites Vite's injected relList.supports(\"modulepreload\") check to require typeof relList.supports === \"function\"
  • disable Vite module preload helper emission with build.modulePreload = false so both modulepreload and dynamic-import preload paths avoid the non-callable relList.supports crash
  • keep this CEF-specific hardening in build config so React can mount reliably instead of failing with a blank desktop window

Test plan

  • pnpm lint
  • pnpm typecheck
  • desktop app launches in CEF without blank white screen regression

Made with Cursor

Summary by CodeRabbit

  • Bug Fixes
    • Resolved runtime compatibility issues in the Desktop CEF environment by improving handling of module preload checks.

M3gA-Mind and others added 7 commits April 30, 2026 16:03
This keeps production release artifacts unchanged while ensuring staging sidecar, bundle lookup, and upload paths align with debug outputs.

Made-with: Cursor
Serialize env-mutating core_process tests with a shared lock so OPENHUMAN_* overrides do not race under parallel test execution in CI.

Made-with: Cursor
Prevent startup blank-screen crashes in desktop builds where `link.relList.supports` is present but not callable by turning off the injected modulepreload polyfill.

Made-with: Cursor
…ts issues.

Introduced a new Vite plugin to replace unsafe usage of relList.supports with a safer check, preventing potential crashes in desktop CEF builds. Updated modulePreload configuration to disable the polyfill for improved stability.
@M3gA-Mind M3gA-Mind requested a review from a team April 30, 2026 14:17
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b9b09e5f-63dd-4036-9551-ae97ae55aadc

📥 Commits

Reviewing files that changed from the base of the PR and between 8a0ed8a and d210433.

📒 Files selected for processing (1)
  • app/vite.config.ts

📝 Walkthrough

Walkthrough

Updates the Desktop CEF runtime workaround in Vite configuration by disabling modulepreload and adding a post-build plugin that guards relList.supports calls with type checking to prevent runtime failures.

Changes

Cohort / File(s) Summary
Vite Configuration CEF Workaround
app/vite.config.ts
Disables build.modulePreload entirely and adds a post-build chunk transformation plugin that wraps relList.supports("modulepreload") calls with typeof relList.supports === "function" guards, preventing failures when the method exists but is not callable.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • senamakel

Poem

🐰 With guards now placed on relList.supports,
No crashes when the function calls deport,
Vite's modules preload? Not this day!
CEF runs safe, in every way,
Our workaround hops toward the sky! 🚀

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: guarding modulepreload relList.supports checks for CEF compatibility, which is the core objective of the PR.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Review rate limit: 4/5 reviews remaining, refill in 12 minutes.

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

@M3gA-Mind M3gA-Mind merged commit a225bd9 into tinyhumansai:main Apr 30, 2026
15 checks passed
AusAgentSmith pushed a commit to AusAgentSmith/openhuman that referenced this pull request May 23, 2026
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