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: avoid onServerPrefetch warning #1281

Merged
merged 1 commit into from
May 3, 2022

Conversation

dominikklein
Copy link
Contributor

@dominikklein dominikklein commented Nov 5, 2021

Avoid the following Vue warning, when queries are used before the Vue mount:

onServerPrefetch is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.

We use some queries before the mount of the main app (outside of a component setup), so that we have already some "general" information at the very beginning (e.g. the authentication information) during the app initialization.

@z0lo13
Copy link

z0lo13 commented Feb 24, 2022

@Akryum looks like this change is not released yet? I am getting the warning

@dominikklein
Copy link
Contributor Author

@Akryum do you think this can be applied in one of the next releases? :-)

@rwam rwam mentioned this pull request Apr 27, 2022
@Akryum Akryum merged commit cf89b25 into vuejs:v4 May 3, 2022
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.

3 participants