ObaidUrRehman / ng-drag-drop

Drag & Drop for Angular - based on HTML5 with no external dependencies. :tada:
MIT License
239 stars 123 forks source link

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

Open mateenQureshi opened 7 years ago

mateenQureshi commented 7 years ago

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

ObaidUrRehman commented 7 years ago

your prod build using AOT?

mateenQureshi commented 7 years ago

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

ObaidUrRehman commented 7 years ago

No, let me look into this.

ghost commented 7 years ago

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

ObaidUrRehman commented 7 years ago

@mateenQureshi did calling forRoot() solve your problem?

mateenQureshi commented 7 years ago

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 commented 7 years ago

Let me know if u need any further details Thank You

seiyria commented 7 years ago

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.