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

[Vue warn]: Property undefined was accessed during render but is not defined on instance. #2910

Closed
wants to merge 1 commit into from

Conversation

rhengles
Copy link

Without this change, I'm getting a lot of this error:

https://prnt.sc/wchiz8

Related to #2270 , but I'm already using @vue/compiler-dom.

@LinusBorg
Copy link
Member

Could you maybe explain the actual problem ? The references issue is not really helpful in understanding the context you are experiencing your issue in.

And I don't think we will accept a change that removes a warning that is otherwise considered useful from our perspective, unless we understand how it actually causes a problem, and under which circumstances.

@rhengles
Copy link
Author

@LinusBorg I understand. The issue is that no application ever would use Symbol.unscopables as a key to its own data, this access is coming from the with(_ctx) {} that is generated by the template compiler, not from my application, so me as a user shouldn't have to see this warning that I can't do anything about.

Please also notice that the message itself is misleading. There is no Property undefined, but that is because JSON.stringify can't translate a symbol.

@LinusBorg
Copy link
Member

LinusBorg commented Dec 31, 2020

That helps a bit but I still don't see how you are seeing a lot of these errors in your app caused by this. an reproduction from a real use case would help us understand what the actual issue and impact is.

@rhengles
Copy link
Author

rhengles commented Dec 31, 2020

@LinusBorg Here is a link to a fiddle: https://jsfiddle.net/s5dtoy7v/

Really, if you simply use a compiled render function from a template, you get this because of the with(_ctx){}.

@LinusBorg
Copy link
Member

You are missing an implementation detail:

https://jsfiddle.net/Linusborg/3tkae0jd/

With that flag, you don't get any more warnings. That's also why the render function works if you let Vue compile it itself, the way it's intended:

https://jsfiddle.net/Linusborg/5xL86wuz/

@LinusBorg LinusBorg closed this Dec 31, 2020
@rhengles
Copy link
Author

rhengles commented Dec 31, 2020

@LinusBorg Thank you for your help!

Of course my fiddle wasn't "intended" to be a way to build production apps, only to show the issue. Now someone else who tries to use the Vue compiler as a step of their workflow can search for this issue and know what they need to do to remove this warning message. ❤

Do you or someone else know what is the rationale for this flag to not be active by default? Or why would someone ever need it disabled?

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.

2 participants