ng-drag-drop icon indicating copy to clipboard operation
ng-drag-drop copied to clipboard

Error: Uncaught (in promise): Error: No provider for Ng2DragDropService!

Open mateenQureshi opened this issue 8 years ago • 8 comments
trafficstars

I am using ng2-drag-drop package in my angular 4 app, i have deployed to staging, the package works fine, but yesterday i deployed it live and started getting the error: Error: Uncaught (in promise): Error: No provider for Ng2DragDropService!

can you please help me to get out of this ASAP Thanks, Looking Forward

mateenQureshi avatar Aug 23 '17 08:08 mateenQureshi

your prod build using AOT?

ObaidUrRehman avatar Aug 23 '17 09:08 ObaidUrRehman

yes exactly, should I remove Ahead Of Time Compilation while deploying production build ?

mateenQureshi avatar Aug 23 '17 09:08 mateenQureshi

No, let me look into this.

ObaidUrRehman avatar Aug 23 '17 10:08 ObaidUrRehman

For us, after Angular upgrade we had to import in app module and call forRoot()

ghost avatar Aug 23 '17 14:08 ghost

@mateenQureshi did calling forRoot() solve your problem?

ObaidUrRehman avatar Aug 28 '17 04:08 ObaidUrRehman

No, actually without calling forRoot() fixes my issue during building, but when I navigate to the app, the component which is using ng2-drag-drop breaks the app by throwing the above exception (ref: title of the issue)

mateenQureshi avatar Aug 28 '17 10:08 mateenQureshi

Let me know if u need any further details Thank You

mateenQureshi avatar Aug 28 '17 10:08 mateenQureshi

I had this same problem (I was using 2.0.2, then noticed my most recent update broke when I pushed and it deployed). I upgraded to 2.9.2 and called .forRoot.

seiyria avatar Oct 01 '17 18:10 seiyria