Uncaught Error: No ErrorHandler. Is platform module (BrowserModule) included?
See original GitHub issueExpected 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.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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:
So I erred on the side of caution in the example, but you are free to tweak as desired!
Thanks @bengourley