simplebar
simplebar copied to clipboard
Simplebar-Angular - onDestroy issue
Describe the bug When SimplebarComponent gets destroyed it throws an exception.
To Reproduce Hard to say.
Expected behavior I think you should check in SimplebarAngularComponent if simplebar is not undefined before unmounting it!
Additional context
Error: Uncaught (in promise): TypeError: Cannot read property 'unMount' of undefined
TypeError: Cannot read property 'unMount' of undefined
at SimplebarAngularComponent.ngOnDestroy (simplebar-angular.js:33)
**Your environment**
Software | Version(s) |
---|---|
SimpleBar | 3.0.0-beta.10 |
any idea why this happens? For me its started happening on the unit tests once the angular is updated to angular 13 and the jest is updated to 28, but surprisingly not in the browser. along with this trace
console.error
ERROR TypeError: import_simplebar_core.default is not a constructor
at SimplebarAngularComponent.ngAfterViewInit (/home/nizamudeena/projects/ceph/src/pybind/mgr/dashboard/frontend/node_modules/simplebar-angular/fesm2020/simplebar-angular.mjs:12:26)
at callHook (/home/nizamudeena/projects/ceph/src/pybind/mgr/dashboard/frontend/node_modules/@angular/core/fesm2020/core.mjs:2558:22)
at callHooks (/home/nizamudeena/projects/ceph/src/pybind/mgr/dashboard/frontend/node_modules/@angular/core/fesm2020/core.mjs:2527:17)
at executeInitAndCheckHooks (/home/nizamudeena/projects/ceph/src/pybind/mgr/dashboard/frontend/node_modules/@angular/core/fesm2020/core.mjs:2478:9)
at refreshView (/home/nizamudeena/projects/ceph/src/pybind/mgr/dashboard/frontend/node_modules/@angular/core/fesm2020/core.mjs:9581:21)
at detectChangesInternal (/home/nizamudeena/projects/ceph/src/pybind/mgr/dashboard/frontend/node_modules/@angular/core/fesm2020/core.mjs:10889:9)
at ViewRef$1.detectChanges (/home/nizamudeena/projects/ceph/src/pybind/mgr/dashboard/frontend/node_modules/@angular/core/fesm2020/core.mjs:21480:9)
I was on version 2.4.1
and now I reduced it to 2.2.1
and there I am facing no issues.