question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error in directive sortable bind hook: "Sortable: `el` must be HTMLElement, and not [object Undefined]"

See original GitHub issue

I have this error:

Error in directive sortable bind hook: “Sortable: el must be HTMLElement, and not [object Undefined]”

I use it on a parent element that wraps a v-for on an imported component. Maybe Vue is still initialising? I see that my components are mounted after this error.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:13
  • Comments:6

github_iconTop GitHub Comments

25reactions
1615450788commented, Apr 2, 2018

This component does not support vue2.0+

10reactions
devsndcommented, Jan 4, 2019

As a workaround, I just modified the code to work with vue 2.x like this:

        Vue.directive('sortable', {
            inserted: function (el) {
                var sortable = new Sortable(el, options)

                if (this.arg && !this.vm.sortable) {
                    this.vm.sortable = {}
                }

                //  Throw an error if the given ID is not unique
                if (this.arg && this.vm.sortable[this.arg]) {
                    console.warn('[vue-sortable] cannot set already defined sortable id: \'' + this.arg + '\'')
                } else if( this.arg ) {
                    this.vm.sortable[this.arg] = sortable
                }
            },
            bind: function (el, binding) {
                this.options = binding.value || {};
            }
        })
Read more comments on GitHub >

github_iconTop Results From Across the Web

vue.js - [Vue warn]: Error in directive sortable update hook ...
[Vue warn]: Error in directive sortable update hook: "Sortable: el must be HTMLElement, and not [object Undefined]" · which version of vue.js are ......
Read more >
[Solved]-[Vue warn]: Error in directive sortable update hook ...
Coding example for the question [Vue warn]: Error in directive sortable update hook: "Sortable: el must be HTMLElement, and not [object Undefined]"-Vue.js.
Read more >
`el` must be HTMLElement, and not [object Undefined]
It worked with the File-folder! However now i get this error when trying to edit an Item Type: del6.PNG.
Read more >
Sortable: `el` must be an HTMLElement, not [object Comment]
I want to use vuedraggable to drag and drop the a-sub-menu component in antdv , and finally the following error will be generated....
Read more >
$compile - AngularJS: API
You can either return a Directive Definition Object (see below) that ... This hook is invoked with no arguments; if detecting changes, you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found