Wordjs addin error: Tracking Prevention blocked access to storage for https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js.
I have a Word addin deployed in multiple environments using a static web app. The code is identical but in one of the environments I am unable to use cookies to maintain my user sessions I also get the following error
Tracking Prevention blocked access to storage for https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js.
but only when using the desktop application. The online version of Word works as usual.
I have seen a lot of mention of this problem, but there are never any answers. The closest thing to an answer I have found is to add the office code inside a setTimeout call, ie: setTimeout(<officecode>, 1000) but that seems to be releated to a slightly different problem.
Other posts include:
https://learn.microsoft.com/en-us/answers/questions/346968/tracking-prevention-blocked-access-storage-storage?comment=question#newest-question-comment