-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
fix(nuxt): resolve watch callback after reactive key change in useAsyncData #33802
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
fix(nuxt): resolve watch callback after reactive key change in useAsyncData #33802
Conversation
|
|
WalkthroughThis pull request modifies the client watch handler within Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (3)**/*.{ts,tsx,vue}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/*.{ts,tsx,js,jsx,vue}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/*.{test,spec}.{ts,tsx,js}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
🧠 Learnings (2)📓 Common learnings📚 Learning: 2025-09-10T14:42:56.647ZApplied to files:
🧬 Code graph analysis (1)test/nuxt/use-async-data.test.ts (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
🔇 Additional comments (2)
Tip ✨ Issue Enrichment is now available for GitHub issues!CodeRabbit can now help you manage issues more effectively:
Disable automatic issue enrichmentTo disable automatic issue enrichment, add the following to your issue_enrichment:
auto_enrich:
enabled: falseThanks 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 |
@nuxt/kit
@nuxt/nitro-server
nuxt
@nuxt/rspack-builder
@nuxt/schema
@nuxt/vite-builder
@nuxt/webpack-builder
commit: |
CodSpeed Performance ReportMerging #33802 will not alter performanceComparing Summary
|
danielroe
left a 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.
thank you ❤️
🔗 Linked issue
Fixes #33777
📝 Description
When using useAsyncData with a reactive key (getter function) and the watch option, the params watcher stops working after the key changes.
Expected: Params changes trigger new fetches
Root Cause
The params watcher captured a static reference to the initial
asyncDatacontainer. When the key watcher detected a key change, it created a new container innuxtApp._asyncData[newKey], but the params watcher continued calling_execute()on the old, stale container.The Fix
Use dynamic lookup to ensure the params watcher always targets the current container:
Testing