fix: remove react-scan external script blocking desktop release build#70
Conversation
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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
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:
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
Summary by CodeRabbit