Skip to content

Conversation

@harlan-zw
Copy link
Contributor

@harlan-zw harlan-zw commented Sep 25, 2025

🔗 Linked issue

📚 Description

All of the useHead* variant composables have an option to provide a direct head instance, this allows the Unhead instance to be passed as a value in nested async code that may have lost the Nuxt context.

We added a nuxt option which does essentially the same thing, but for consistency to the underlying API we should honour head before trying to resolve the instance through Nuxt.

This is quite an edge case and likely didn't affect anyone, but it did catch me out.

function useSeo() {
	const head = injectHead()
    const seoData = await fetchSeo()
    // would break in Nuxt v4 as it resolves through Nuxt first
    useSeoMeta(seoData, { head })
}

@bolt-new-by-stackblitz
Copy link

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

@coderabbitai
Copy link

coderabbitai bot commented Sep 25, 2025

Warning

Rate limit exceeded

@harlan-zw has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 19 minutes and 28 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 1451432 and d11880d.

📒 Files selected for processing (1)
  • packages/nuxt/src/head/runtime/composables.ts (3 hunks)
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/head-option-use-head

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.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 25, 2025

Open in StackBlitz

@nuxt/kit

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

nuxt

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

@nuxt/rspack-builder

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

@nuxt/schema

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

@nuxt/vite-builder

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

@nuxt/webpack-builder

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

commit: d11880d

@codspeed-hq
Copy link

codspeed-hq bot commented Sep 25, 2025

CodSpeed Performance Report

Merging #33318 will not alter performance

Comparing fix/head-option-use-head (d11880d) with main (1451432)

Summary

✅ 10 untouched

@danielroe danielroe merged commit 98ecc62 into main Sep 25, 2025
49 of 50 checks passed
@danielroe danielroe deleted the fix/head-option-use-head branch September 25, 2025 11:18
@github-actions github-actions bot mentioned this pull request Sep 25, 2025
danielroe pushed a commit that referenced this pull request Oct 6, 2025
@github-actions github-actions bot mentioned this pull request Oct 6, 2025
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.

3 participants