Skip to content

Improve error handling for Storage class #916

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

Closed
jasonnutter opened this issue Aug 8, 2019 · 4 comments
Closed

Improve error handling for Storage class #916

jasonnutter opened this issue Aug 8, 2019 · 4 comments
Assignees
Labels
compatibility Related to compatibility with specific frameworks, environments, browsers, etc. enhancement Enhancement to an existing feature or behavior.

Comments

@jasonnutter
Copy link
Contributor

The Storage class will only work if it is instantiated in an environment (the browser) where window.sessionStorage or window.localStorage exist. Currently, UserAgentApplication assumes that any uncaught error from the Storage constructor is a result of an invalid cacheLocation string, however, an error could be thrown if window doesn't exist at all, such as when msal is server-side rendered. We should add a new error message to catch this scenario.

See: #914

AC:

  1. When msal is server-side rendered, it throws an error message communicating that it cannot be server-side rendered.
@jasonnutter jasonnutter added enhancement Enhancement to an existing feature or behavior. compatibility Related to compatibility with specific frameworks, environments, browsers, etc. labels Aug 8, 2019
@jodonnell
Copy link
Contributor

i believe this is causing syncweek-react-aad/react-aad#104 and the issues @scottyh527 is having at the bottom of this thread
syncweek-react-aad/react-aad#95

@jasonnutter
Copy link
Contributor Author

@jodonnell Thanks, that info is helpful.

@github-actions
Copy link
Contributor

This issue has not seen activity in 14 days. It may be closed if it remains stale.

@github-actions github-actions bot added the no-issue-activity Issue author has not responded in 5 days label May 28, 2020
@tnorling tnorling removed the no-issue-activity Issue author has not responded in 5 days label May 28, 2020
@jasonnutter
Copy link
Contributor Author

This is being addressed in MSAL.js v2, closing.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compatibility Related to compatibility with specific frameworks, environments, browsers, etc. enhancement Enhancement to an existing feature or behavior.
Projects
None yet
Development

No branches or pull requests

4 participants