'Uncaught Error: Can't resolve all parameters for' runtime error when upgrading from Angular 4 to 5.0.1

前端 未结 3 679
后悔当初
后悔当初 2020-12-19 17:59

This is fine in Angular 4.x, just not Angular 5.0.1. This project was generated with Angular CLI.

compiler.js:466 Uncaught Error: Can\'t resolve all paramet         


        
相关标签:
3条回答
  • 2020-12-19 18:38

    In Angular 5 Update blog post the author mentions that they are using a static injector instead of a reflection based one and mentions that the reflection polyfills are no longer needed but in my case it was.

    If you removed the polyfills for reflections try adding them again:

    import 'core-js/es6/reflect';
    import 'core-js/es7/reflect';
    

    I hope it woks for you as well.

    0 讨论(0)
  • 2020-12-19 18:39

    In my case, for Angular 6.1 migration, it was a missing:

    import "reflect-metadata";
    import "zone.js";
    

    inside the bootfile.

    0 讨论(0)
  • 2020-12-19 18:45

    The error mentions that you're using a wron constructor for RegistrationService.

    0 讨论(0)
提交回复
热议问题