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 TypeError: Cannot read property dismiss of null (alert.js)

See original GitHub issue

I keep getting random events where the error is:

Uncaught TypeError: Cannot read property 'dismiss' of null

alert_bug

The error is coming from the Alert default module on Line 113, in alert.js:

	hide_alert: function(sender) {
		//Dismiss alert and remove from this.alerts
		this.alerts[sender.name].dismiss();  // <<========= LINE  113 !
		this.alerts[sender.name] = null;
		//Remove overlay
		var overlay = document.getElementById("overlay");
		overlay.parentNode.removeChild(overlay);
},

@MichMich
Does this have to be null or can it also be set to "" or something else? Any ideas how to fix or work around this?

I’m surprised nobody else has reported this issue, so I want to eliminate that it is a problem with my module.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
pavirocommented, Apr 2, 2018

I really hoped someone would replace this 💩 code really fast 😅

1reaction
MichMichcommented, Apr 2, 2018

@paviro It will hunt you for the rest of you life. 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'dismiss' of undefined in ionic ...
I created below class to handle show hide of loading in my ionic application. loading.service.ts import { Injectable } from '@angular/core'; ...
Read more >
Uncaught TypeError: Cannot read property of null - iDiallo
It says it cannot set property disabled of null. Where is disabled used? They are the elements with id btConsulta, btDescargar and btHist....
Read more >
TypeError: Cannot read property 'dismiss' of undefined
Hi everyone! I have implemented a service with two methods for creating and closing a loading controller, like this.
Read more >
How to fix this " Uncaught TypeError: Cannot read properties ...
Scenario 1 is that it is trying to read data from the server response and no data is available. Scenario 2 is that...
Read more >
How to deal or remove "Cannot read property 'destroy' of null"
"Cannot read property 'destroy' of null" - This error has occurred because the underlying js implementation gets failed to initialize the global ......
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