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(timeline-helper-wrapper): Fix return value in timeline wrapper for promises #567

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

Vespand
Copy link
Contributor

@Vespand Vespand commented Jan 8, 2024

This PR fixes bug of usage timeline option with useAsyncData with lazy: true

Type of change

  • 🐞 Bug fix (a non-breaking change that fixes an issue)

Description

Case if bug:

  • useAsyncData returns only promise, without data, pending and others

Reproduction

  • Reproduction branch - added reproduction in ./playgrounds/empty (JFI - it only works on local machine, in stackblitz timeline metrics can't be enabled)
  • useAsyncData() return not only promise, it also return a lot additional attributes, like data, pending, error, example:
image
  • After use useAsyncData() with metrics wrapper returning value is only promise, example with timeline enabled:
image
  • Without timeline: { enabled: true } } all working as expected

This happens, because .finally() returns only Promise, without additional attributes, added by useAsyncData()

Looking for feedback about fix :)

@antfu antfu merged commit 0645e35 into nuxt:main Jan 8, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants