-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
docs: add custom nuxt module addServerPlugin warning #33409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: add custom nuxt module addServerPlugin warning #33409
Conversation
|
|
WalkthroughA documentation file (docs/3.api/5.kit/11.nitro.md) was updated. A warning block was added under the addServerPlugin section stating that defineNitroPlugin must be explicitly imported from nitropack/runtime, with a similar note for utilities like useRuntimeConfig. No source code or public API changes are included; this is a content-only docs update. Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
docs/3.api/5.kit/11.nitro.md (1)
200-202: Align the example with the new warningThe new warning tells readers they must explicitly import
defineNitroPlugin(and similar utilities), yet the example immediately below still omits that import. This contradiction will confuse module authors. Please update the snippet—at least addimport { defineNitroPlugin } from 'nitropack/runtime'at the top ofruntime/plugin.ts, and likewise show imports for any other utilities you mention.
🔗 Linked issue
#33406
📚 Description
Registering nitro plugin within custom nuxt module does not work out of the box. You actually have to explicitly import stuff like
defineNitroPluginoruseRuntimeConfigfor it to work. Added that section to the docs.