aws-mobile-appsync-sdk-js
aws-mobile-appsync-sdk-js copied to clipboard
Failed to read the 'localStorage' property from 'Window': Access is denied for this document
Note: If your issue/feature-request/question is regarding the AWS AppSync service, please log it in the official AWS AppSync forum
Do you want to request a feature or report a bug? bug
What is the current behavior?
- In incognito window mode of chrome browser "disable cookies" button
- try loading the script, it fails to access localStorage since the localStorage property exists but access is restricted
- the handling in the current code(paho-mqtt) is checking if a property exists instead
Error Uncaught SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
- In incognito window mode of chrome browser "disable cookies" button
- try loading the script, it fails to access localStorage since the localStorage property exists but access is restricted
- the handling in the current code(paho-mqtt) is checking if a property exists instead it should gracefully handle it by catching the exception and polyfill it.
What is the expected behavior? it should gracefully handle it by catching the exception and polyfill it.
Which versions and which environment (browser, react-native, nodejs) / OS are affected by this issue? Did this work in previous versions?
nodejs : 14.X browser: chrome
the expected handling is done in https://github.com/aws/aws-sdk-js/blob/307e82673b48577fce4389e4ce03f95064e8fe0d/lib/credentials/cognito_identity_credentials.js#L362