Exception: Call to Node module failed with error: Error: Uncaught (in promise): Error: DI Error Error: DI Error

image

I received the above error.  Turns out I didn’t add the service to the providers.  Not a very helpful error message though so I figured I would blog it.

Before Fix

@Component({     selector: 'home',     templateUrl: './home.component.html'
})

After Fix

@Component({     selector: 'home',     templateUrl: './home.component.html',

providers: [ MyService ] })

At some point during this I had gotten ‘no provider for’ which lead me to here: http://stackoverflow.com/questions/30580083/angular2-no-provider-for-nameservice

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s