Skip to content

fix(nuxt): avoid any return type from callHookWith in vue:setup#34584

Merged
danielroe merged 1 commit intonuxt:mainfrom
yamachi4416:fix-callHookWith-return-type-any
Mar 15, 2026
Merged

fix(nuxt): avoid any return type from callHookWith in vue:setup#34584
danielroe merged 1 commit intonuxt:mainfrom
yamachi4416:fix-callHookWith-return-type-any

Conversation

@yamachi4416
Copy link
Contributor

@yamachi4416 yamachi4416 commented Mar 15, 2026

🔗 Linked issue

📚 Description

the same logic caused a type error in the nuxt upgrade PR in test-utils

error TS2554: Expected 3 arguments, but got 2.

nuxt/test-utils#1616

before:
image

after:
image

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 15, 2026

Open in StackBlitz

@nuxt/kit

npm i https://pkg.pr.new/@nuxt/kit@34584

@nuxt/nitro-server

npm i https://pkg.pr.new/@nuxt/nitro-server@34584

nuxt

npm i https://pkg.pr.new/nuxt@34584

@nuxt/rspack-builder

npm i https://pkg.pr.new/@nuxt/rspack-builder@34584

@nuxt/schema

npm i https://pkg.pr.new/@nuxt/schema@34584

@nuxt/vite-builder

npm i https://pkg.pr.new/@nuxt/vite-builder@34584

@nuxt/webpack-builder

npm i https://pkg.pr.new/@nuxt/webpack-builder@34584

commit: f8a3f8c

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 15, 2026

Merging this PR will not alter performance

✅ 20 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing yamachi4416:fix-callHookWith-return-type-any (28b8e53) with main (a24fa40)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@yamachi4416 yamachi4416 marked this pull request as ready for review March 15, 2026 11:33
@yamachi4416 yamachi4416 requested a review from danielroe as a code owner March 15, 2026 11:33
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 15, 2026

Walkthrough

The nuxt-root.vue component has been modified to pass an additional argument to the callHookWith method when invoking the 'vue:setup' hook. The hook invocation now receives an empty array as a third parameter. This adjustment modifies the function call signature whilst maintaining the existing hook execution logic and subsequent runtime error checks. One line has been added and one removed as part of this change.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: fixing a type safety issue by avoiding a loose 'any' return type from callHookWith in the vue:setup hook.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description is related to the changeset, providing context about a type error fix and referencing a related test-utils PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

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 and usage tips.

@danielroe danielroe added this pull request to the merge queue Mar 15, 2026
Merged via the queue into nuxt:main with commit d2268f9 Mar 15, 2026
48 checks passed
@github-actions github-actions bot mentioned this pull request Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants