Skip to content

fix: import defineNuxtPlugin in intercept plugin - #842

Merged
harlan-zw merged 1 commit into
mainfrom
fix/explicit-plugin-import
Jul 23, 2026
Merged

fix: import defineNuxtPlugin in intercept plugin#842
harlan-zw merged 1 commit into
mainfrom
fix/explicit-plugin-import

Conversation

@harlan-zw

Copy link
Copy Markdown
Collaborator

🔗 Linked issue

Resolves#841

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

The generated proxy intercept plugin called defineNuxtPlugin without importing it. Add an explicit nuxt/app import so apps with imports.autoImport: false can initialize the plugin.

@vercel

vercelBot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
scripts-playgroundReadyReadyPreview, CommentJul 22, 2026 11:47pm

Request Review

@pkg-pr-new

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/scripts@842

commit: 5845109

@coderabbitai

coderabbitaiBot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The intercept plugin template now prepends an explicit defineNuxtPlugin import from nuxt/app before exporting the plugin. A unit test verifies that generated contents include this import when Nuxt auto-imports are disabled.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Linked Issues check✅ PassedThe change adds the missing import and test coverage for issue #841, matching the expected fix.
Out of Scope Changes check✅ PassedThe PR stays focused on the import fix and its test, with no clear unrelated changes.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check✅ PassedThe title clearly identifies the main change: adding a defineNuxtPlugin import to the intercept plugin.
Description check✅ PassedThe description matches the change and explains the auto-import issue it fixes.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/explicit-plugin-import

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@harlan-zwharlan-zw changed the title fix(proxy): import defineNuxtPlugin in intercept pluginfix: import defineNuxtPlugin in intercept pluginJul 23, 2026
@harlan-zw
harlan-zw merged commit 8a2c985 into mainJul 23, 2026
18 checks passed
@harlan-zw
harlan-zw deleted the fix/explicit-plugin-import branch July 23, 2026 00:01
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

defineNuxtPlugin is not defined when using nuxt scripts without autoImports.

1 participant

@harlan-zw