Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught (in promise) TypeError: Document not active #120

Closed
Hariss096 opened this issue Feb 14, 2019 · 2 comments
Closed

Uncaught (in promise) TypeError: Document not active #120

Hariss096 opened this issue Feb 14, 2019 · 2 comments

Comments

@Hariss096
Copy link

The error is coming when the app is first launched. The problem is on line 102:

document[fn.exitFullscreen]();

I fixed this issue by catching the error thrown by the promise like this :

document[fn.exitFullscreen]().catch(() => {});

Would love to have this solution officially.

For reference, I am using version 3.3.3. I also updated to the latest version which is at the moment v4.0.0 but the error is still there.

@kepner03
Copy link

I faced the same issue with Chrome 72.

There was an other solution in jpilfold/ngx-image-viewer#23
what has worked for me too.

  1. Go to the file : ~src/node_modules/screenfull/dist/screenfull.js .
  2. find around line 100 the exit function .
    3.replace with the following :
exit: function () {
   if (this.isFullscreen) {
	document[fn.exitFullscreen]();
  }
},

@sunnibfgi
Copy link

fix solution:
document.exitFullscreen().catch(err => Promise.resolve(err))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants