Skip to content

Unhandled Promise rejection: Failed to read the 'sessionStorage' property from 'Window': Access is denied for this document #641

@LeonardoDavinci

Description

@LeonardoDavinci

Describe the bug
When a user blocks a site from saving data, the whole angular app crashes when using the library.

Stackblitz example
Any app that uses the library, and has blocked the site from storing data in chrome.

To Reproduce

  1. Block the site from accessing data. Go to chrome://settings/content/cookies and add the domain in the block section.

Screenshot 2019-09-30 at 14 21 17

2. Reload the site

Expected behavior
Probably the library won't work without being able to save data, but at least it shouldn't crash.

Desktop (please complete the following information):

  • OS: Mac
  • Browser: chrome
  • Version: 77

Additional context
Unhandled Promise rejection: Failed to read the 'sessionStorage' property from 'Window': Access is denied for this document. ; Zone: ; Task: Promise.then ; Value: DOMException: Failed to read the 'sessionStorage' property from 'Window': Access is denied for this document.
at createDefaultStorage (http://localhost:4200/vendor.js:170856:5)
at _callFactory (http://localhost:4200/vendor.js:89741:20)
at _createProviderInstance (http://localhost:4200/vendor.js:89684:26)
at resolveNgModuleDep (http://localhost:4200/vendor.js:89628:21)
at _createClass (http://localhost:4200/vendor.js:89725:32)
at createProviderInstance (http://localhost:4200/vendor.js:89681:26)
at resolveNgModuleDep (http://localhost:4200/vendor.js:89628:21)
at NgModuleRef
.get (http://localhost:4200/vendor.js:90736:16)
at resolveDep (http://localhost:4200/vendor.js:91266:45)
at createClass (http://localhost:4200/vendor.js:91119:32) Error: Failed to read the 'sessionStorage' property from 'Window': Access is denied for this document.
at createDefaultStorage (http://localhost:4200/vendor.js:170856:5)
at _callFactory (http://localhost:4200/vendor.js:89741:20)
at _createProviderInstance (http://localhost:4200/vendor.js:89684:26)
at resolveNgModuleDep (http://localhost:4200/vendor.js:89628:21)
at _createClass (http://localhost:4200/vendor.js:89725:32)
at createProviderInstance (http://localhost:4200/vendor.js:89681:26)
at resolveNgModuleDep (http://localhost:4200/vendor.js:89628:21)
at NgModuleRef
.get (http://localhost:4200/vendor.js:90736:16)
at resolveDep (http://localhost:4200/vendor.js:91266:45)
at createClass (http://localhost:4200/vendor.js:91119:32)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugFor tagging faulty or unexpected behavior.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions