Subscribe on changes!

[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.

avatar
Aug 27th 2020

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)

avatar
Aug 28th 2020

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.

avatar
Aug 28th 2020

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.

avatar
Nov 9th 2020

@posva i have the same warn , and then it output an error like image i seem like a vue error , how can i fixed it ? thank a lot

avatar
Nov 9th 2020

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 () at flushJobs (runtime-core.esm-bundler.js:356)

avatar
Jul 5th 2021

image

I have to save my component ( forms) to store and it gives me this