fix: ReferenceError in production builds from qrcodegen namespace emi… - #622
Conversation
#621) Convert the vendored qrcodegen library from TypeScript namespaces to plain ES module exports and target ES2020 in the library build. The namespace merge emit (`let t; … t ||= ns.QrCode ||= {}`) was mis-compiled by consumers' minifiers when down-levelling to ES2020, dropping the declaration and throwing `ReferenceError: l is not defined` at load time. Claude-Session: https://claude.ai/code/session_013HWYkRT6siHoTpX2cAYLoU
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedNext included review available in 41 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (7)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughThe QR code generator was converted from a TypeScript namespace default export to named ES module exports. Consumers and types now use those exports. The Vite build targets ES2020, and documentation records the production-build crash fix. ChangesQR code build fix
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The QR generator now uses ES module exports and ships an ES2020-targeted build to prevent the documented production load-time crash. Consumer wiring and error-correction behavior remain aligned, with no outstanding merge-readiness risk identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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. A rabbit sees exports stand clear, Comment |
Run dist/index.es.js through esbuild (pinned to 0.28.1, the last release that reproduces #621) at es2015/es2020/es2022/esnext, then execute each result by rendering a QR code with react-dom/server. Guards against consumer bundlers mis-compiling the shipped output. Claude-Session: https://claude.ai/code/session_013HWYkRT6siHoTpX2cAYLoU
Parse dist/index.es.js with acorn at ecmaVersion 2020. If the bundle contains only ES2020 syntax, no consumer bundler has to down-level it, which rules out the #621 class of bug independently of any minifier's version. esbuild is unpinned and the Dependabot ignore is removed. Claude-Session: https://claude.ai/code/session_013HWYkRT6siHoTpX2cAYLoU
…t (#621)
Convert the vendored qrcodegen library from TypeScript namespaces to plain ES module exports and target ES2020 in the library build. The namespace merge emit (
let t; … t ||= ns.QrCode ||= {}) was mis-compiled by consumers' minifiers when down-levelling to ES2020, dropping the declaration and throwingReferenceError: l is not definedat load time.Claude-Session: https://claude.ai/code/session_013HWYkRT6siHoTpX2cAYLoU
Summary by CodeRabbit
Bug Fixes
Documentation