OfficeDev / Office-Addin-TaskPane-Angular

Template to get start started writing a TaskPane Office Add-in for the Angular framework using TypeScript
Other
14 stars 19 forks source link

CORS issue to load png as icon & css styles not working after hot reload #104

Open sefatanam opened 1 year ago

sefatanam commented 1 year ago

Hi,

I continuously getting errors to load icon in bar because of CORS issue & styles also not working after making any changes in ts file. I just pull it and after installing node dependencies. Start the app via npm run dev-server & import the manifest file in word app in browser.

Access to image at 'https://localhost:3000/assets/icon-80.png' from origin 'https://word-edit.officeapps.live.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'

and styles are also not loading,

Refused to apply style from 'https://localhost:3000/1fda685b81e1123773f6.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

Running in

image image

millerds commented 1 year ago

I'm not able to reproduce the CORS error (note I don't have an ubuntu setup, so I'm trying on windows using Edge). Where is the document you are sideloading that add-in to stored? Can you give more specific steps you are using to sideload the add-into the doc in the browser?

The css issue has been reported before and we are investigating. Seems to be specifically related to the hot reloading when the css is linked to in the html, but we haven't figured out the exact cause yet.