Repository navigation
fix(build): ignore MODULE_LEVEL_DIRECTIVE warnings - #4696
Conversation
A dependency whose modules start with "use client" printed one MODULE_LEVEL_DIRECTIVE warning per module in the server build. The directive only matters to React Server Components bundlers, so add the code to the warnings the rollup, rolldown and vite builders already ignore. Also drop a leftover console.log of each warning code in the rolldown builder. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@kaanisthatyou is attempting to deploy a commit to the Nitro Team on Vercel. A member of the Team first needs to authorize it. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe build warning handlers now suppress ChangesBuild warning handling
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to The change addresses the noisy build warnings without an identified merge-blocking issue. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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 |
…nings nitro 3.0.260903-beta. It now builds the server with the project's Vite and rolldown 1.2.12 instead of its own 1.1.1. The Vercel output is the same: identical config.json, a 36 MB function, takumi's native addon traced. rolldown 1.2.9 warns about every "use client" directive it meets, 152 of them in the server build, where the directive means nothing. Nitro ignores the code upstream (nitrojs/nitro#4696, not yet released); until then the Nitro rolldown config drops that one log and hands every other to Nitro's own filter.
🔗 Linked issue
Resolves #4695
❓ Type of change
📚 Description
A dependency whose modules start with
"use client"printed oneMODULE_LEVEL_DIRECTIVEwarning per module in the server build. The directive only matters to React Server Components bundlers, so this adds the code toignoreWarningCodes, which the rollup, rolldown and vite builders already share. It also removes a leftoverconsole.log(warning.code)from the rolldown builder'sonwarn.The new unit test calls
onwarnof all four builder configs (rollup, rolldown, vite with rollup, vite with rolldown): the"use client"warning is dropped and other warnings are still forwarded. It fails onmainfor all four. With the issue's repro, the published3.0.260903-betaprints 15 warnings and this branch prints none; the built server still responds.📝 Checklist