Console NOT logging error "can't read property 'something' of undefined"

Hi all, has anyone had an issue lately related to the errors log? for example if I want to access to a property of an undefined variable I should get an error in the console saying can't access to a property 'something' of undefined.I have had this issue for some time now and is really annoying because it stops execution and it’s really hard to tell where is the error. Thanks!

"@angular/common": "4.0.0",
"@angular/compiler": "4.0.0",
"@angular/compiler-cli": "4.0.0",
"@angular/core": "4.0.0",
"@angular/forms": "4.0.0",
"@angular/http": "4.0.0",
"@angular/platform-browser": "4.0.0",
"@angular/platform-browser-dynamic": "4.0.0",
"ionic-angular": "3.0.1",

"devDependencies": {
"@ionic/app-scripts": "^2.1.4",
"@ionic/cli-plugin-cordova": "1.6.1",
"@ionic/cli-plugin-ionic-angular": "1.4.1",
"@types/jasmine": "2.5.35",
"browserify": "13.0.0",
"browserify-istanbul": "2.0.0",
"codelyzer": "3.0.0-beta.4",
"es6-shim": "0.35.1",
"ionic": "3.7.0",
"isparta": "4.0.0",
"run-sequence": "1.1.5",
"tsify": "0.16.0",
"tslint": "^5.6.0",
"typescript": "~2.2.1",
"watchify": "3.7.0"

What exactly happens instead?

Also post your ionic info output please.

1 Like

Hi @Sujan12 thanks for your answer, what happens in the situation you describe is that nothing is being logged in the console so there is no way to find why the execution stopped. I’m working with more than 2 people in the project and we all have the same issue.

cli packages: (/home/alfredo/workspace/falck-in-safe-hands-mobile/node_modules)

@ionic/cli-plugin-cordova       : 1.6.1
@ionic/cli-plugin-ionic-angular : 1.4.1
@ionic/cli-utils                : 1.7.0
ionic (Ionic CLI)               : 3.7.0

global packages:

Cordova CLI : 7.0.1 

local packages:

@ionic/app-scripts : 2.1.4
Cordova Platforms  : android 6.2.3 ios 4.5.1
Ionic Framework    : ionic-angular 3.0.1


Node : v6.11.3
OS   : Linux 4.10
npm  : 3.10.10

This is old and should be updated.

Same here, which would also get rid of some of the plugins.

What are you doing when something should happen? Right now I only know that some error is not happening.

We implemented a Rollbar and someone deleted the line that was logging the errors in our project.

import { Injectable, ErrorHandler } from '@angular/core';
import { IonicErrorHandler } from 'ionic-angular';

declare let Rollbar: any;

export class RollbarErrorHandler extends IonicErrorHandler implements ErrorHandler {
  constructor() {

  handleError(err: any): void {
    Rollbar.error(err.originalError || err);
    console.error(err); //this line was deleted 

Solved. Thanks