-
Notifications
You must be signed in to change notification settings - Fork 1k
CORS errors when loading resources from config.json #6259
Copy link
Copy link
Closed
Labels
area:spfxCategory: SharePoint Framework (not extensions related)Category: SharePoint Framework (not extensions related)status:answeredAnswer to a question.Answer to a question.status:by-designTopic described is by design & not considered an issue.Topic described is by design & not considered an issue.type:questionQuestion... if answered, will be tagged as such.Question... if answered, will be tagged as such.
Metadata
Metadata
Assignees
Labels
area:spfxCategory: SharePoint Framework (not extensions related)Category: SharePoint Framework (not extensions related)status:answeredAnswer to a question.Answer to a question.status:by-designTopic described is by design & not considered an issue.Topic described is by design & not considered an issue.type:questionQuestion... if answered, will be tagged as such.Question... if answered, will be tagged as such.
Category
Question
I have a webpart which uses external library according to (https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/basics/add-an-external-library#load-a-script-from-a-cdn). Everything works fine however I always see CORS errors when SP page tries to load this library. Also same errors are seen when SP page tries to load localizedResources from config.json.
Errors are like:
"Access to script at 'https:///development/sharepoint/v1/assets/v1-commonstrings_en-us_cc83c7b1d8f44bf102f81e223fdf4b06.js' from origin 'https://*.sharepoint.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource."
I also investigated that localizedResources and external libs are loaded twice by script "https://spoprod-a.akamaihd.net/files/sp-client/sp-pages-assembly_en-gb_187009d50ea1060e33206e49000cbf6e.js":
Environment details (development & target environment)