Skip to content
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): only warn when useAsyncData returns undefined #28154

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

xjccc
Copy link
Contributor

@xjccc xjccc commented Jul 15, 2024

🔗 Linked issue

resolves #28096

📚 Description

@xjccc xjccc requested a review from danielroe as a code owner July 15, 2024 11:07
Copy link

stackblitz bot commented Jul 15, 2024

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

@xjccc xjccc changed the title fix: useAsyncData warn when returing undefined fix: useAsyncData warn when returning undefined Jul 15, 2024
@danielroe danielroe changed the title fix: useAsyncData warn when returning undefined fix(nuxt): only warn when useAsyncData returns undefined Jul 15, 2024
@danielroe danielroe merged commit 4948710 into nuxt:main Jul 15, 2024
42 checks passed
@github-actions github-actions bot mentioned this pull request Jul 15, 2024
@xjccc xjccc deleted the fix/28096 branch July 16, 2024 11:09
@github-actions github-actions bot mentioned this pull request Jul 18, 2024
nag5000 added a commit to nag5000/nuxt that referenced this pull request Jul 22, 2024
@Brain1024
Copy link

@danielroe Hi, I updated Nuxt to 3.12.4. When I use useAsyncData to return null, the following warning occurs:
WARN [nuxt] useAsyncData must return a value (it should not be undefined) or the request may be duplicated on the client side.
However, I also found that the request is still duplicated on the client side. It seems we only modified the warning content, but the behavior remains the same as in version 3.12.2.

@danielroe
Copy link
Member

@Brain1024 That is correct. The request will be duplicated if it is either undefined or null. That will not change until Nuxt 4.

@Brain1024
Copy link

@Brain1024 That is correct. The request will be duplicated if it is either undefined or null. That will not change until Nuxt 4.

ok, I got it, thanks.

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.

Should useAsyncData emit warn in dev mode when returning false or '' values?
3 participants