Usage of globals breaks SSR
See original GitHub issuePlease follow the issue template below. Failure to do so will result in a delay in answering your question.
Library
-
msal@1.3.0
or@azure/msal@1.x.x
-
@azure/msal-browser@2.x.x
-
@azure/msal-angular@1.0.0-beta.5
-
@azure/msal-angular@1.x.x
-
@azure/msal-angularjs@1.x.x
Framework
Angular v9
Description
When trying to start my application with SSR and installed MSAL Library the application breaks because of the extensive direct usage of globals. It first breaks at TelemetryManager but I have seen that there are a lot of other potential unsafe usages of globals.
Security
Is this issue security related?
Regression
Did this behavior work before?
Configuration
Please provide your MSAL configuration options.
// Provide configuration values here.
// For Azure B2C issues, please include your policies.
Reproduction steps
- Create Angular project with SSR
- Install msal + msal angular
- Try to start SSR
Expected behavior
SSR works without errors
Browsers
Is this issue browser-specific? If so, please detail which browsers are impacted (e.g. IE 11, Safari).
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Built-in Globals and User references in a paginated report
The total number of pages relative to page breaks that reset PageNumber. If no page breaks are set, this value is the same...
Read more >You Can Definitely Use Global Variables To Manage Global ...
Solution · Create a global state(which is technically a global variable) · Subscribe a component(s) to a created global state(this lets the global...
Read more >Global state in SSR with Vue and Node.js - Medium
In a Node.js environment, these requests are not processed in isolated threads, but within a single thread with one global state.
Read more >kopiro/eslint-plugin-ssr-friendly - GitHub
Disallow use of DOM globals in class constructors, as this will break SSR if you're instantiating this class as singleton or you're rendering...
Read more >Global References in SSRS - Tutorial Gateway
The Built-in Fields Collection includes the Global references in SSRS. These are used in common report design such as: Page Numbers, Total Page...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@DaSchTour Unfortunately, server-side rendering is currently considered out of scope for the library, given it’s heavy reliance on the browser environment, as you have noticed. This is something we may consider improving in the future, but for now, it is recommended to not include MSAL in server render paths, and only include it client-side.
Fixed in v2 via #2073