Skip to content

metadata_resolver.js Uncaught Error: Can't resolve all parameters for UserService: (Http, ?). #4

@nextstopsun

Description

@nextstopsun

I'm trying to run this example as an Angular CLI app. It uses webpack by default instead of SystemJS. The bundle gets built with no errors, but I've got this error on the page:

metadata_resolver.js:508 Uncaught Error: Can't resolve all parameters for UserService: (Http, ?).

CompileMetadataResolver.getDependenciesMetadata @   metadata_resolver.js:508
CompileMetadataResolver.getTypeMetadata @   metadata_resolver.js:405
(anonymous function)    @   metadata_resolver.js:552
CompileMetadataResolver.getProvidersMetadata    @   metadata_resolver.js:532
CompileMetadataResolver.getNgModuleMetadata @   metadata_resolver.js:285
RuntimeCompiler._compileComponents  @   runtime_compiler.js:126
RuntimeCompiler._compileModuleAndComponents @   runtime_compiler.js:64
RuntimeCompiler.compileModuleAsync  @   runtime_compiler.js:55
PlatformRef_._bootstrapModuleWithZone   @   application_ref.js:303
PlatformRef_.bootstrapModule    @   application_ref.js:285
(anonymous function)    @   main.ts:12
__webpack_require__ @   bootstrap 4990ebf…:52
(anonymous function)    @   zone.js:1327
__webpack_require__ @   bootstrap 4990ebf…:52
webpackJsonpCallback    @   bootstrap 4990ebf…:23
(anonymous function)    @   main.bundle.js:1

I guess it has something to do with the second argument of UserService constructor, which is of type AuthenticationService: private authenticationService: AuthenticationService.

@cornflourblue Can you please give a clue how to solve this error? I'm a noob in Angular and webpack seems a lot more easier (with literally no configuration) than SystemJS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions