Skip to content

fix(nuxt): async-data executes should return new promise on deduplication#33740

Merged
danielroe merged 7 commits intonuxt:mainfrom
OrbisK:fix/async-data-cancel-server
Nov 25, 2025
Merged

fix(nuxt): async-data executes should return new promise on deduplication#33740
danielroe merged 7 commits intonuxt:mainfrom
OrbisK:fix/async-data-cancel-server

Conversation

@OrbisK
Copy link
Member

@OrbisK OrbisK commented Nov 20, 2025

🔗 Linked issue

fixes #33737

📚 Description

My approach is to always return the new deduped promise for useAsyncData executes, if the promise is rejected from deduplication. This causes all executions to resolve simultaneously because they are the 'same' promise, and I believe this is the intended behaviour. If I want to perform some actions after execution, I want to do so after the new promise has been resolved, rather than when the old one has been deduplicated.

execute().then(()=>console.log(1)) 
execute().then(()=>console.log(2))
execute().then(()=>console.log(3)) 
// all resolve at the same time after the last execute is resolved

Loading
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.

useAsyncData returns undefined in SSR when component is used multiple times

2 participants