Hey guys, I've been going crazy for a full day over this bug, thinking i must be missing something (i still might be)
basically I get an error every time I use dispose, including this super simple reduced case:
https://codepen.io/dimam-bestreet/pen/GPmoxX
no error..
error... ^^
If there are any errors at all, please include them here.
VM76237:214 Uncaught TypeError: Cannot read property 'classList' of null
at VideojsDelegate (
at add_element (
at MutationObserver.
I've checked in firefox - no error!
I am using crome (Chromium 65) on linux (if that has anything to do with anything)
7.3.0
Chromium 65, firefox seems ok
I've checked only mine - linux mint 17.3
nope
Is this is only related to the fact im using Chromium 65??
👋 Thanks for opening your first issue here! 👋
If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.
Unfortunately, I'm unable to reproduce locally or in browserstack on chrome 65 on win10 or macos.
I'll test it on my phone this week, if it works - no problem really...
Thank you!
Dima
On Wed, Dec 26, 2018 at 7:55 PM Gary Katsevman notifications@github.com
wrote:
Unfortunately, I'm unable to reproduce locally or in browserstack on
chrome 65 on win10 or macos.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/videojs/video.js/issues/5706#issuecomment-450001073,
or mute the thread
https://github.com/notifications/unsubscribe-auth/Abs89BaKeDeLN4nsMsm96jy9Lq0WO3gNks5u87gEgaJpZM4ZfsEF
.
I think i've seen this in a unit test before (so don't wait for ready event but dispose right away or something like that).
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi,
I also notice the same issue, with almost the exact same stack trace for VideoJs 6.6. It also only occurs in Chrome. We block our instance from calling dispose if not ready like this:
if(this.player) {
this.player.dispose();
}
We instantiate the player like this:
const nonReadyPlayer = videojs(
this.videoId,
this.videoConfig,
() => {
this.player = nonReadyPlayer;
}
);
As we cannot reproduce this exception, it is difficult to pinpoint why this is occurring in a very small number of instances ( n<0.01% of requests). I also cannot find any references to VideoJsDelegate MutationObserver in VideoJs release 6.6.
Is there any specific behavior for autoplay that needs to be guarded against in chrome?
Where does VideoJSDelegate come from if not from video.js repo?
Thanks!
I think i found a good stack trace. I will attach as our bug tracking too reports it as it is easy to read as formatted.

@gkatsev can this be re-opened? A check for element seems to be needed in dom.js:
if (element && element.classList) {
I'm not seeing an error locally.
While I'm not necessarily opposed to adding a null check to that method but almost always there's something else that needs to be fixed in cases like this.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
While I'm not necessarily opposed to adding a null check to that method but almost always there's something else that needs to be fixed in cases like this.
Can you re-open this ticket @gkatsev?
Anyone have info on how to reproduce this issue?
@gkatsev See above, there are steps to reproduce in the initial description. It appears to be related to disposing and re-creating video-js objects within a component
As I mentioned above, I'm unable to reproduce with either the test page or locally.
As I mentioned above, I'm unable to reproduce with either the test page or locally.
I wasn't able to reproduce it with that test page either, but while playing with it, I was able to break it using:
videojs("my_video", {}, function ready() {
console.log("ready");
videojs("my_video").dispose();
});
I don't think it should throw this/any error:

Looks like a different error but related to disposing. It probably should handle that case gracefully. Probably a timing issue with preselectTrack there.
I agree. Wouldn't surprise me that fixing this issue reveals the other issue..
@gkatsev
Is there a plan to release this in 7.10.2 ? https://github.com/videojs/video.js/pull/6701
Would be really nice. I am seeing this error a lot lately.
(Using videojs + videojsima plugin)
This error gets thrown when I get AdsLoader error: AdError 303: No Ads VAST response after one or more Wrappers
And after player tries to dispose, this error(Cannot read property 'classList' of null) gets thrown.
But for some reason only when I hard reload the page.
We just merged #6967, hopefully that should fix some of the issues related to this.