ngx-sortablejs
ngx-sortablejs copied to clipboard
ERROR TypeError: Cannot read property 'option' of undefined at ngx-sortablejs.js:203
Cannot read property 'option' of undefined
this.sortableInstance is undefined。 what is sortableInstance?
I ran into this issue using an older build of angular-sortablejs. The error seems to be related to a new minor release of sortablejs 1.10.0. In my case, downgrading to sortablejs 1.7.0 fixed it.
"angular-sortablejs": "^2.7.0",
"sortablejs": "~1.7.0",
I am getting the same error in 3.1.4
I am also seeing this in 3.14 with sortablejs version 1.10.0. It looks like the ngOnChanges method is firing before the create method resolves and creates the sortableInstance.
Everything is working fine after the error, it's just an initial issue. Should be fixable in the package by updating the ngOnChanges function to only execute the option change when the instance exists:

However, I don't have an alternative for the consumer side, so the console gets filled with this error on load.
I made a quick PR to hopefully help with resolving this ^
I would really appreciate it if this got fixed sooner rather than later.
@blackbaud-conorwright I don't see anywhere that the sortableInstance is defined in order to check against it from within my component.
Issue still exist in 11.1.0 version, do you find a way to solve it?