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

(migration build) WATCH_ARRAY in @vue/compat is triggered by RouterView #1315

Closed
daniilskr opened this issue Feb 18, 2022 · 2 comments
Closed
Labels
has workaround A workaround has been found to deal with the issue

Comments

@daniilskr
Copy link

Version

3.2.30

Reproduction link

github.com

Steps to reproduce

You can either clone repository(Link to minimal reproduction) or create app with vue-router and @vue/compat

What is expected?

"[Vue warn]: (deprecation WATCH_ARRAY)..." should be triggered only when the user code is "watching" an array in some of his components with the "watch" option

What is actually happening?

"[Vue warn]: (deprecation WATCH_ARRAY)" is triggered by the RouterView when user does not watch any arrays in his components with the "watch" option


I ran into this bug during migration from vue2 to vue3

@daniilskr daniilskr reopened this Feb 18, 2022
@LinusBorg LinusBorg transferred this issue from vuejs/core Feb 18, 2022
@LinusBorg
Copy link
Member

@posva We likely should add a compatConfig: { MODE: 3 } to RouterView and RouterLink to keep any such compar warnings from popping up for them - the router's own components don't need to run in compat mode, anyway.

@posva posva added the has workaround A workaround has been found to deal with the issue label Feb 18, 2022
@posva
Copy link
Member

posva commented Feb 18, 2022

That's true. It would be nice if they could be set without adding anything for v3 users.
Right now users can directly add the options while using @vue/compat:

import { RouterView, RouterLink } from 'vue-router'

RouterView.compatConfig = { MODE: 3 }
RouterLink.compatConfig = { MODE: 3 }

It would be better if it worked out of the box though

@posva posva closed this as completed in 92becf6 Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has workaround A workaround has been found to deal with the issue
Projects
None yet
Development

No branches or pull requests

3 participants