$headers.windowLocation is returning null. Exporting $headers to a JSON file shows the values are present. I can also enumerate through the values matching the key and then retrieving the value.
UniversalDashboard.Charts 1.3.3 is causing “Minified React error #31”. I was able to manually install version 1.3.2 and the errors stopped.
NOTE: Upgraded from 2.7.3 to 2.8.1; previously installed via MSI prior to 2.8.1. Uninstalled 2.7.3 and then installed 2.8.1 via Install-Module Universal.
I tried the header variable again and it was working when I tested with your code. Tried a few more times between different authentication methods and it kept working; was the only change I made between my first report of the issue and your reply. Then suddenly it stopped. Here is the odd thing, the first time I received the error message using Show-UDToast, my file had the correct value. Refreshed the page and now the text file is empty as well.
Another oddity, the code I had in a shared module has reverted back to when I first saw the problem. My changes to enumerate through and find the key is gone. My original code is now working again in the shared module (sample code above doesn’t use this shared module though):