vue-multiselect: ReferenceError: deepClone is not defined

Suddenly started to get this error when using vue-multiselect:

ReferenceError: deepClone is not defined
    at deepClone (eval at 167 (2.app.js:79), <anonymous>:8:20)
    at VueComponent.data (eval at 165 (2.app.js:65), <anonymous>:57:57)
    at VueComponent.mergedDataFn (eval at <anonymous> (app.js:146), <anonymous>:963:18)
    at VueComponent.mergedDataFn (eval at <anonymous> (app.js:146), <anonymous>:964:19)
    at initData (eval at <anonymous> (app.js:146), <anonymous>:3170:12)
    at initState (eval at <anonymous> (app.js:146), <anonymous>:3123:5)
    at VueComponent.Vue._init (eval at <anonymous> (app.js:146), <anonymous>:3376:5)
    at new VueComponent (eval at <anonymous> (app.js:146), <anonymous>:3498:12)
    at createComponentInstanceForVnode (eval at <anonymous> (app.js:146), <anonymous>:1728:10)
    at init (eval at <anonymous> (app.js:146), <anonymous>:1738:43)
logError @ vue.js?3de6:439

only in Chrome.

Did anyone face with it? Any ideas how to fix?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 48 (15 by maintainers)

Most upvoted comments

You can also fork it and affect a fix within your forked copy.

I was asked to make a change on my PR, I am traveling for work but will try to affect it tonight.

Yes that works because that’s how the component is designed to nullify itself. I agree that it’s hacky but it satisfies how vue-multiselect works. If my PR were adopted then providing “null” as input would work fine which is preferred.

This stems from one of the conditional checks on {whatever-the-selected-values-array-is-called}.length. It checks for a singular input and casts to an array but it does not do the same on a null input, so when the .length Array prototype method is called, it throws an exception.