Given the following:
<button :value.sync="missing">click</button>
results in the following error in the Chrome console:
Uncaught TypeError: Cannot read property 'length' of undefined
There is no mention:
<button>foo.vueAn improvement would be to say:
Error: bound object 'missing' on element``<button>``can't be found in file foo.vue
Similarly, this error could be more useful if it showed which component was trying to reference this element.
vue.common.js?f9a0:1019[Vue warn]: Unknown custom element: <component-a> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
thanks for the awesome project!!
Step into a similar error when using objects as props. If an element inside that object is bound to the template and the element is missing, the same error is thrown.
As it is a Javascript error, the browser ends the code executions and the page may not be rendered correctly.
It will be great if props of type object are checked for existence and all the child members of that object that are used in the template.
Just want to check the code to see if I can patch it... It seems that this error should be checked on the render function, right? Should I check in the vue template compiler then?
Thanks!
its also an issue when accessing sub properties of non-existing properties.
e.g. {{options.title}} where options is not yet defined. IMHO it would be better to follow the angular way and just resolve string interpolations with errors to empty string and only log this error in non-release mode
Do you guys have a gitter that I can join and receive some support in getting this issue assigned to me and worked on? I am a first timer to OSS!
@dmcfaddengalway We have, but I discourage you from starting with this feature because it's a 1.x feature request and pretty old
Here are the forum Discord server, and gitter
Most helpful comment
its also an issue when accessing sub properties of non-existing properties.
e.g.
{{options.title}}where options is not yet defined. IMHO it would be better to follow the angular way and just resolve string interpolations with errors to empty string and only log this error in non-release mode