fix(nitro): scope runtime config probes to active major version#340
fix(nitro): scope runtime config probes to active major version#340HugoRCD wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Thank you for following the naming conventions! 🙏 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughEvlog patches its Nitro runtime config bridge to declare the active major version (v2 or v3) early in plugin startup, so the bridge probes only the matching runtime module instead of attempting both. This prevents Bun from auto-installing missing optional dependencies on Vercel's read-only filesystem. ChangesNitro Runtime Version Activation for Config Probing
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Benchmark reportBundle size
|
commit: |
|
@gtothesquare Can you try running |
🔗 Linked issue
Closes #312
📚 Description
On Vercel + Bun + Nitro v3, every request crashed with
bun is unable to write files: ReadOnlyFileSystem. Root cause: the shared config bridge probednitropack/runtime/internal/configeven though onlynitro(v3) was installed. Bun's auto-install kicked in on the missing dynamic import and tried to writenode_modules/.cache, which is read-only on Vercel functions.The fix introduces an internal
setActiveNitroRuntime('v2' | 'v3')declaration. Both Nitro plugins call it as their first synchronous statement, and the bridge probes only the matching runtime —nitro/runtime-configfor v3,nitropack/...for v2. Adapters resolving config throughruntimeConfig.evlog.<adapter>benefit from the same restriction, socreatePostHogDrain()(and anyresolveAdapterConfigconsumer) no longer triggers cross-version probes.process.env.__EVLOG_CONFIGremains the highest-priority lookup; the historical fallback chain still applies when no runtime has been declared (standalone use outside Nitro).No public-API change.
📝 Checklist
Summary by CodeRabbit
Bug Fixes
Tests