Skip to content

resolveComponent() Inside Computed Property no longer works in Vue 3.4 #10884

Discussion options

You must be logged in to vote

From https://vuejs.org/api/render-function.html#resolvecomponent:

resolveComponent() must be called inside either setup() or the render function in order to resolve from the correct component context.

You can't safely use resolveComponent inside a computed, as it isn't guaranteed to be evaluated during setup or rendering.

It's essentially the same problem I described in #9974. The reactivity system was significantly rewritten in 3.4, leading to some subtle changes to the timing of when things ran. This wasn't a change to the documented API, but code that implicitly relied on the previous timing of the calls will fail with 3.4.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Pertta
Comment options

Answer selected by Pertta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants