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

ERROR TypeError: Cannot read property 'option' of undefined at ngx-sortablejs.js:203 #172

Open
liwei511 opened this issue Aug 16, 2019 · 8 comments · May be fixed by #200
Open

ERROR TypeError: Cannot read property 'option' of undefined at ngx-sortablejs.js:203 #172

liwei511 opened this issue Aug 16, 2019 · 8 comments · May be fixed by #200

Comments

@liwei511
Copy link

Cannot read property 'option' of undefined

@liwei511
Copy link
Author

this.sortableInstance is undefined。
what is sortableInstance?

@dvose
Copy link

dvose commented Sep 20, 2019

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",

@codekrafter
Copy link

I am getting the same error in 3.1.4

@blackbaud-conorwright
Copy link

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:
image

However, I don't have an alternative for the consumer side, so the console gets filled with this error on load.

@blackbaud-conorwright
Copy link

I made a quick PR to hopefully help with resolving this ^

@dylanhouston7
Copy link

I would really appreciate it if this got fixed sooner rather than later.

@TheGameKnave
Copy link

@blackbaud-conorwright I don't see anywhere that the sortableInstance is defined in order to check against it from within my component.

@dmmishchenko
Copy link

Issue still exist in 11.1.0 version, do you find a way to solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants