[Vue warn]: Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.
Version
3.0.0-rc.9
Reproduction link
https://github.com/mon-compte-github/vue-3-avoid-app-logic-issue
Steps to reproduce
$ git clone git@github.com:mon-compte-github/vue-3-avoid-app-logic-issue.git
$ cd vue-3-avoid-app-logic-issue/
$ npm install
$ npm run serve
Choose a category and watch browser's console.
What is expected?
no warning
What is actually happening?
[Vue warn]: Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.
The sample project is a subset of a personal project (no design, mocked data). Everything seems to work fine, including in production mode, but this warning keep firing .. and i don't understand why.
BTW, vue 3 rocks (reactive, ref, ... <3)
Cannot reproduce but I see the warning you are talking about. You cannot use any code that would rely on enumerating the keys of a component instance (getCurrentInstance
) like Obeject.keys
or other functions.
I tried searching where it comes from but I couldn't find it in your code.
I tried searching where it comes from but I couldn't find it in your code.
I didn't either ¯\_(ツ)_/¯ that's why i opened this ticket . Thanks for your reply anyway.
@posva i have the same warn , and then it output an error like i seem like a vue error , how can i fixed it ? thank a lot
Uncaught (in promise) TypeError: Cannot read property 'id' of null
at getId (runtime-core.esm-bundler.js:339)
at runtime-core.esm-bundler.js:356
at Array.sort (