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

v-bind with empty key #11040

Open
andrewharvey opened this issue Jan 21, 2020 · 1 comment
Open

v-bind with empty key #11040

andrewharvey opened this issue Jan 21, 2020 · 1 comment
Labels
improvement warnings related to development warnings

Comments

@andrewharvey
Copy link

andrewharvey commented Jan 21, 2020

Version

2.6.11

Reproduction link

https://jsfiddle.net/andrewharvey4/k6r3uzby/10/

Steps to reproduce

v-bind an object with a empty string key

What is expected?

vue not to crash, it to either be silently ignored or a warning but not a fatal error

What is actually happening?

an error is thown crashing the app

vue.js:4483 Uncaught DOMException: Failed to execute 'setAttribute' on 'Element': '' is not a valid attribute name.
    at baseSetAttr (https://unpkg.com/vue@2.6.11/dist/vue.js:6778:10)
    at setAttr (https://unpkg.com/vue@2.6.11/dist/vue.js:6753:7)
    at Array.updateAttrs (https://unpkg.com/vue@2.6.11/dist/vue.js:6708:9)
    at invokeCreateHooks (https://unpkg.com/vue@2.6.11/dist/vue.js:6064:24)
    at initComponent (https://unpkg.com/vue@2.6.11/dist/vue.js:5997:9)
    at createComponent (https://unpkg.com/vue@2.6.11/dist/vue.js:5980:11)
    at createElm (https://unpkg.com/vue@2.6.11/dist/vue.js:5920:11)
    at createChildren (https://unpkg.com/vue@2.6.11/dist/vue.js:6048:11)
    at createElm (https://unpkg.com/vue@2.6.11/dist/vue.js:5949:11)
    at Vue.patch [as __patch__] (https://unpkg.com/vue@2.6.11/dist/vue.js:6509:11)
@posva posva added improvement warnings related to development warnings labels Jan 21, 2020
@elshuku
Copy link

elshuku commented Apr 5, 2020

Exact same error is given when v-bind has an extra : infront of it
<my-comp v-bind:={prop1, prop2}> My Comp </my-comp>

This is picked during run-time instead of compile with stack trace and message having no information about where it happened.

Not sure if it's worth re-opening this, or creating another issue.

This happens in 2.6.11

CallumChaney added a commit to CallumChaney/vue that referenced this issue Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement warnings related to development warnings
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants