Skip to content

fix: remove react-scan external script blocking desktop release build#70

Merged
aaditagrawal merged 1 commit intomainfrom
fix/remove-react-scan-external-script
Apr 17, 2026
Merged

fix: remove react-scan external script blocking desktop release build#70
aaditagrawal merged 1 commit intomainfrom
fix/remove-react-scan-external-script

Conversation

@aaditagrawal
Copy link
Copy Markdown
Owner

@aaditagrawal aaditagrawal commented Apr 17, 2026

What

Removes the unconditional `<script src="//unpkg.com/react-scan/dist/auto.global.js">` tag from `apps/web/index.html`.

Why

The Release Desktop workflow (run #24564459052) fails with:

```
BuildScriptError: Bundled client references missing files in apps/server/dist/client/index.html:
//unpkg.com/react-scan/dist/auto.global.js. Rebuild web/server artifacts.
```

The `validateBundledClientAssets` function in `scripts/build-desktop-artifact.ts` skips references starting with `http://` or `https://`, but the protocol-relative `//unpkg.com/...` form falls through to the local-file existence check and errors out.

This script has been in `index.html` for a while but never caught because the regular `Format, Lint, Typecheck, Test, Browser Test, Build` CI doesn't exercise the desktop artifact packaging — only the `Release Desktop` workflow does, and that's triggered manually.

Scope

`react-scan` is a dev-only re-render visualization tool. Removing it from the HTML:

  • Fixes the desktop release build
  • Drops an external CDN runtime dependency from the production bundle
  • Removes one network fetch per user page load

If dev-time scanning is still wanted, add it conditionally via a Vite env guard or the `@react-scan/vite-plugin-react-scan` plugin (neither change is required for this fix).

Test plan

  • Re-run the Release Desktop workflow after merge — build should pass the `validateBundledClientAssets` step.
  • `bun typecheck` unaffected (no type references to removed script).
  • Local `bun run build --filter @t3tools/web` produces a bundle without external `//unpkg.com` refs.

Summary by CodeRabbit

  • Chores
    • Removed the React monitoring auto-instrumentation script from the application startup, reducing initial page load scripts.

The //unpkg.com/react-scan/dist/auto.global.js script was loaded
unconditionally in production bundles, failing validateBundledClientAssets
in scripts/build-desktop-artifact.ts (skips http:// and https:// URLs but
not protocol-relative //). Blocks the Release Desktop workflow.

react-scan is a dev-only re-render visualization tool; no place in
production bundles (adds external CDN dep on unpkg, runs in every user's
browser). For dev-time scanning, add it conditionally via Vite env or
@react-scan/vite-plugin-react-scan.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 17, 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: 63012b7d-cdeb-4e10-aede-3c06dfb2149d

📥 Commits

Reviewing files that changed from the base of the PR and between 5a2d587 and 92cf6e4.

📒 Files selected for processing (1)
  • apps/web/index.html
💤 Files with no reviewable changes (1)
  • apps/web/index.html

📝 Walkthrough

Walkthrough

The react-scan auto-instrumentation script reference was removed from apps/web/index.html. The script previously loaded from a CDN at page startup, and its removal eliminates this external dependency from the application's HTML entry point. No other structural changes were made.

Changes

Cohort / File(s) Summary
HTML Configuration
apps/web/index.html
Removed react-scan auto-instrumentation script that was loaded from CDN at page startup.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested labels

size:M

Poem

🐰 A scan we once had, now goodbye it goes,
One line removed where the script used to flow,
React runs lighter, with less on its plate,
A cleaner beginning, oh isn't it great! 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: remove react-scan external script blocking desktop release build' clearly and concisely summarizes the main change—removing the problematic react-scan script that blocks the desktop release build.
Description check ✅ Passed The PR description is well-structured and covers the template requirements: it explains what changed (removal of react-scan script), why (desktop build failure), scope (dev-only tool impact), and includes a test plan.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/remove-react-scan-external-script

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 and usage tips.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 effective changed lines (test files excluded in mixed PRs). labels Apr 17, 2026
@aaditagrawal aaditagrawal merged commit 9602c18 into main Apr 17, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 effective changed lines (test files excluded in mixed PRs). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant