question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught Error: No ErrorHandler. Is platform module (BrowserModule) included?

See original GitHub issue

Expected behavior

Able to build and deploy angular 5 application with bugsnag using ng build --prod

Observed behavior

The follow error occurs straight away. Uncaught Error: No ErrorHandler. Is platform module (BrowserModule) included?

Steps to reproduce

Follow bugsnag angular 5 integration instructions

Version

4.2.0

Additional information

package.json dependancy "@angular/platform-browser": "^5.2.2",

Importing BrowserModule at top of app.module import { BrowserModule } from '@angular/platform-browser';

Adding BrowserModule to imports

imports: [
        BrowserModule,
        ...
    ],

ng build works fine (development). After removing the following line { provide: ErrorHandler, useClass: BugsnagErrorHandler } everything is fine.

2018-01-26_18-19-28

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bengourleycommented, Jan 26, 2018

I read mixed things about the AOT compiler – one said that you mustn’t use lambdas in places like that. But I saw some conflicting example that said it translates examples like that into something like:

export function a0 () { return new BugsnagErrorHandler(bugsnagClient) }

{ provide: ErrorHandler, useFactory: a0 }

So I erred on the side of caution in the example, but you are free to tweak as desired!

0reactions
grantfeldmancommented, Jan 29, 2018

Thanks @bengourley

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular2 Error - Is platform module (BrowserModule) included?
I'm just trying to run a simple index.html page in Angular2, but its showing me an error ...
Read more >
Ionic 3 Error "Is platform module (BrowserModule) included?"
I've already tried to remove npm, ionic and cordova completely with a fresh install. import { ErrorHandler, NgModule } from '@angular/core'; ...
Read more >
[Solved]-Angular2 bootstrap error: Error: No ExceptionHandler ...
Coding example for the question Angular2 bootstrap error: Error: No ExceptionHandler. Is platform module (BrowserModule) included?-angular.js.
Read more >
What could go wrong? How to handle errors in Angular
Let's turn our attention towards our error handler modal. A pretty simple working solution would be displaying the error message and the ...
Read more >
Error Handling with Angular 6 - Tips and Best Practices - Rollbar
In order to catch uncaught errors, you need to implement an error handler, ... import { BrowserModule } from '@angular/platform-browser'; ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found