ngx-slider icon indicating copy to clipboard operation
ngx-slider copied to clipboard

core.js:4073 ERROR Error: Expecting instance of DOM Element

Open soorireddy opened this issue 4 years ago • 7 comments

issue after upgrading angular 9 to 10.

core.js:4073 ERROR Error: Expecting instance of DOM Element at assertDomElement (core.js:18198) at getListeners (core.js:18114) at DebugNode__POST_R3__.get listeners [as listeners] (core.js:28572) at DebugRenderer2.listen (core.js:31374) at EventListenerHelper.attachEventListener (ng5-slider.js:680) at SliderComponent.onStart (ng5-slider.js:2703) at ng5-slider.js:2608 at SafeSubscriber._next (ng5-slider.js:686) at SafeSubscriber.push../node_modules/ng5-slider/node_modules/rxjs/Subscriber.js.SafeSubscriber.__tryOrUnsub (Subscriber.js:242) at SafeSubscriber.push../node_modules/ng5-slider/node_modules/rxjs/Subscriber.js.SafeSubscriber.next (Subscriber.js:189)

soorireddy avatar Jun 28 '20 11:06 soorireddy

@soorireddy Do you find any solution ?

Matthi0uw avatar Jul 31 '20 07:07 Matthi0uw

Got the same problem, angular 10 - every time I try moving the any slider circle know I got this error ERROR Error: Expecting instance of DOM Element at assertDomElement (core.js:18271) at getListeners (core.js:18187) at DebugNode__POST_R3__.get (core.js:28530) at DebugRenderer2.listen (core.js:31332) at EventListenerHelper.attachEventListener (event-listener-helper.ts:76) at SliderComponent.onStart (slider.component.ts:1810) at slider.component.ts:1701 at SafeSubscriber._next (event-listener-helper.ts:83) at SafeSubscriber.__tryOrUnsub (Subscriber.ts:258) at SafeSubscriber.next (Subscriber.ts:208)

I have aot: true In angular.json. I have "enableIvy": false in tsconfig.json.

I am using version 1.2.6. @rzajac @piotrdz @ValentinH any solutions??

danfleser avatar Oct 30 '20 19:10 danfleser

It looks like it is blowing up on attaching an event listener to global document object.

If document is not defined, or is patched/replaced somewhere, there is little I can do.

To find out more, we would need a minimum reproduction example such as a StackBlitz, where the problem can be reliably reproduced.

piotrdz avatar Oct 31 '20 20:10 piotrdz

I don't think there is any problem with my code as with version 1.1.13 works with no problems. Only after I update to 1.2.6, I got this error. Can you give it a check with angular 10 and ivy OFF? I will try to reproduce an example on StackBlitz.

danfleser avatar Nov 02 '20 13:11 danfleser

@danfleser Before marking a release, I run through a list of supported Angular versions, including variants with and without Ivy.

So I still cannot reproduce it, even with a freshly created Angular 10 project with Ivy turned off.

I suspect it might be one or two things:

  1. an interplay with specific rxjs version you are using in your project,
  2. how slider options are used, or changed at runtime.

Either way, I would need a demonstrable StackBlitz example to solve this.

piotrdz avatar Nov 03 '20 06:11 piotrdz

Same problem after upgrading angular 8 to 9.

My solution: Clone repository in another directory and npm install

internetismylord avatar Feb 02 '21 18:02 internetismylord

Same problem for me. Our situation is a bit different. The control works correctly in a local environment but gets the error the moment we put the application in a hosted environment.

ccanada-eagle avatar May 11 '21 01:05 ccanada-eagle

Closing old issues related to previous Angular versions. Newest release supports current Angular version (17) without issues.

piotrdz avatar Feb 15 '24 07:02 piotrdz