Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.
/frameworkPublic archive

fix(nuxt): await asyncData if ssr: false - #4791

Merged
pi0 merged 1 commit into
mainfrom
fix/spa-await
May 6, 2022
Merged

fix(nuxt): await asyncData if ssr: false#4791
pi0 merged 1 commit into
mainfrom
fix/spa-await

Conversation

@danielroe

Copy link
Copy Markdown
Member

🔗 Linked issue

resolvesnuxt/nuxt#13917

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

We should await useAsyncData on initial load if there was no SSR.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroedanielroe added bug Something isn't working 🔨 p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage labels May 4, 2022
@danielroe
danielroe requested a review from pi0May 4, 2022 09:16
@danielroedanielroe self-assigned this May 4, 2022
@netlify

netlifyBot commented May 4, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt3-docs canceled.

NameLink
🔨 Latest commitadd71fd
🔍 Latest deploy loghttps://app.netlify.com/sites/nuxt3-docs/deploys/62724465551325000b619ebe

@pi0

pi0 commented May 6, 2022

Copy link
Copy Markdown
Member

I was thinking if we could make fix more generic and try to refetch if for any reason key is not in the payload (it can be ssr: false but also timeout for fallback)

@danielroe

danielroe commented May 6, 2022

Copy link
Copy Markdown
MemberAuthor

Those are both nice ideas, but we wouldn't want to await on fetch in those cases as it would cause a hydration mismatch. (I think the solution to this bug and those is not connected.)

Can we make that another issue and resolve in future PR? (happy to look at it straight away)

pi0
pi0 approved these changes May 6, 2022
@pi0
pi0 merged commit 87c6251 into mainMay 6, 2022
@pi0
pi0 deleted the fix/spa-await branch May 6, 2022 11:04
@pi0pi0 mentioned this pull request May 6, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3.xbugSomething isn't working🔨 p3-minor-bugPriority 3: a bug in an edge case that only affects very specific usage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When ssr: false, useAsyncData doesn't await fetches

2 participants

@danielroe@pi0