Conversation
…ipts
Nuxt's plugin `provide` mechanism automatically prepends `$` to every key
returned from a plugin's `provide` object. The generated plugin was returning
`{ provide: { $scripts: ... } }` — with an explicit `$` already in the key —
causing Nuxt to produce `$$scripts` instead of `$scripts`.
Fix: remove the extra `$` from the generated provide key so Nuxt produces the
correct `$scripts` property, matching both the CDN-mode path and the declared
types.
Fixes nuxt#622
|
@zizzfizzix is attempting to deploy a commit to the Nuxt Team on Vercel. A member of the Team first needs to authorize it. |
commit: |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe change corrects a bug where npm-mode registry scripts were inaccessible via the typed API. The template plugin's provide key is modified from Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 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 unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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 |
|
Looks like some CI issues but happy to merge and I'll fix these up myself. Thanks! |
Summary
nuxtApp.$$scriptsinstead ofnuxtApp.$scripts, making them inaccessible via the typed APIRoot Cause
Nuxt's plugin
providemechanism automatically prepends$to every key. The generated plugin was returning{ provide: { $scripts: ... } }— with an explicit$already in the key — causing Nuxt to double it to$$scripts.Fix
Remove the extra
$from the generated provide key (Option A as suggested by @harlan-zw):Nuxt's
providethen adds$→$scripts✓No type changes needed — the type declaration already correctly declares
NuxtApp.$scripts.Closes #622