Skip to content

improve asyncData warning #27874

@719media

Description

@719media

Summary (generated):

Here is a summary of the text in English:

The author of the message is describing a warning they received while using the Nuxt framework. They are unsure why the warning is occurring, but believe that the issue may be with returning falsey values such as an empty string. They think that the error message should be more clear about the cause of the problem.


Describe the feature

This warning was happening to me: https://github.com/nuxt/nuxt/pull/27599/files
I am ignorant about fine-grained reasons for this warning, but I think clarity on the cause would help.

I think it should probably be more clear that the problem is with falsey values? In my case, I was returning empty string and wondering why I was getting this warning when I knew I was not null or undefined. The error message made it sound like the only problem values were null and undefined explicitly.

Because I am not sure what the real problem is here, I didn't do a simple PR to change the language. Is it actually the case that the problem is with falsey values? A more clear explanation is visible in the code comments, for example, here:
https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/app/composables/asyncData.ts#L132C2-L132C73

Thanks for reading!

Additional information

  • Would you be willing to help implement this feature?
  • Could this feature be implemented as a module?

Final checks

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions