Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.
This repository was archived by the owner on May 1, 2020. It is now read-only.

Uncaught Error: Invalid provider for the NgModule 'ServiceModule' - only instances of Provider and Type are allowed #320

@mbakker96

Description

@mbakker96

Short description of the problem:

I've pipes, services, component and pipes modules in my application that are imported into the app module. I make use of barrels for import but when i run it since ionic RC2 I get this error:

metadata_resolver.js:559Uncaught Error: Invalid provider for the NgModule 'ServiceModule' - only instances of Provider and Type are allowed, got: [[object Object], ?undefined?, ...]
    at http://localhost:8100/build/main.js:25207:23
    at Array.forEach (native)
    at CompileMetadataResolver.getProvidersMetadata (http://localhost:8100/build/main.js:25171:19)
    at CompileMetadataResolver.getNgModuleMetadata (http://localhost:8100/build/main.js:24930:58)
    at http://localhost:8100/build/main.js:24873:50
    at Array.forEach (native)
    at CompileMetadataResolver.getNgModuleMetadata (http://localhost:8100/build/main.js:24860:44)
    at RuntimeCompiler._compileComponents (http://localhost:8100/build/main.js:40894:47)
    at RuntimeCompiler._compileModuleAndComponents (http://localhost:8100/build/main.js:40832:37)
    at RuntimeCompiler.compileModuleAsync (http://localhost:8100/build/main.js:40823:21)

Becease it is a private repo I can't share the application.

Which @ionic/app-scripts version are you using?

"dependencies": {
    "@angular/common": "2.1.1",
    "@angular/compiler": "2.1.1",
    "@angular/compiler-cli": "2.1.1",
    "@angular/core": "2.1.1",
    "@angular/forms": "2.1.1",
    "@angular/http": "2.1.1",
    "@angular/platform-browser": "2.1.1",
    "@angular/platform-browser-dynamic": "2.1.1",
    "@angular/platform-server": "2.1.1",
    "@ionic/storage": "1.1.6",
    "@types/jasmine": "^2.5.35",
    "ionic-angular": "2.0.0-rc.2",
    "ionic-native": "2.2.3",
    "ionicons": "3.0.0",
    "ng2-translate": "^3.1.3",
    "rxjs": "5.0.0-beta.12",
    "zone.js": "0.6.21"
  },
  "devDependencies": {
    "@ionic/app-scripts": "0.0.39",
    "typescript": "^2.0.3"
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions