sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

CDN issues with SPFx solutions with resource files

Open PaoloPia opened this issue 3 years ago • 11 comments

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Developer environment

Windows

What browser(s) / client(s) have you tested

  • [ ] 💥 Internet Explorer
  • [ ] 💥 Microsoft Edge
  • [ ] 💥 Google Chrome
  • [ ] 💥 FireFox
  • [ ] 💥 Safari
  • [ ] mobile (iOS/iPadOS)
  • [ ] mobile (Android)
  • [X] not applicable
  • [ ] other (enter in the "Additional environment details" area below)

Additional environment details

  • Edge Version 117.0.2045.41 (Official build) (64-bit)
  • SPFx 1.18

Describe the bug / error

Starting from today, when I upload a SPPKG file of a SPFx (v. 1.18) solution into the AppCatalog, if the solution does have multiple resource files (like en-us.js, it-it.js, etc.) I get random errors from the Microsoft 365 CDN and the solution doesn't work (web parts or extensions, I'm experiencing the issue with both). I noticed the problem only on a specific tenant (piasysdev.onmicrosoft.com) while I cannot reproduce it on other tenants. However, it could be that there is something rolling out and my dev tenant is just in an earlier ring compared to the others that I tested the issue on.

The exceptions that I see are like:

  • net::ERR_ABORTED 500 (Internal Server Error)
  • Refused to execute script from 'https://publiccdn.sharepointonline.com/piasysdev.sharepoint.com/sites/AppCatalog/ClientSideAssets/eba74957-de58-4ec1-9432-012641b8515e/TestStringsWebPartStrings_en-us_3bd812ceda191f7235a1db0c41d7c3a7.js' because its MIME type ('application/json') is not executable, and strict MIME type checking is enabled.

You can see the following screeshot.

spfx-cdn-issue-092023

I can experience the issue on multiple SPFx solutions and I created a really simple one (a fresh new SPFx Web Part with 3 resource string files and nothing more than that) for the sake of giving you a reference repro sample. You can find the repro here: https://github.com/PaoloPia/spfx-cdn-issue-092023/tree/main/spfx-cdn-issue-repro

For the sake of completeness, you can search in the logs for a request with the following SharePoint Correlation ID: 5691dea0-60bd-7000-4920-3995ec29de1e.

Thanks for your support.

Steps to reproduce

  1. Download the sample repro
  2. npm i
  3. gulp bundle --ship && gulp package-solution --ship
  4. upload the package in the AppCatalog
  5. add the TestStrings web part to a page (workbench or any other modern page)
  6. if your tenant is impacted by the issue, you will see the above exception

Expected behavior

I'd like to see the web part rendering like it used to be in the past

PaoloPia avatar Sep 27 '23 15:09 PaoloPia

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

ghost avatar Sep 27 '23 15:09 ghost

I am also having this exact issue with SPFx 1.16.1

We see this in 2 tenants that we are working with right now. It seems to be isolated only to them for the time being.

I believe this issue is the same as #9226.

spdavid avatar Sep 28 '23 10:09 spdavid

In #9226 it looks like the server is responding with a 200, so it might be a different issue.

Here it looks like the server is responding with a 500.

Could you post the actual response from the server for the en_us strings file? I think it may be an error JSON instead of the actual JS file.

nick-pape avatar Sep 28 '23 15:09 nick-pape

Yes, I don't think it is actually related to #9226 even if both are apparently related to the CDN. I don't have the content of the file, because I always get a 500.

image

Moreover, yesterday and the day before the issue was intermittent. Now it is constantly there and the solution simply doesn't work. Consider also that we've been experiencing the issue with multiple SPPKG files, not just with one single solution. And the same SPPKG files, published on other tenants work like charm.

Thanks.

PaoloPia avatar Sep 28 '23 15:09 PaoloPia

Right so the issue affects a single tenant consistently, but the same SPPKG works on other tenants consistently.

I don't have the content of the file, because I always get a 500.

What is in the response/preview tab? Is it just blank?

Would you mind sending the entire Request/Response headers as well?

I'll take a look at the correlation ID additionally.

nick-pape avatar Sep 28 '23 15:09 nick-pape

@nick-pape the response body is empty. Attached you can see the dump of the request/response headers. Thanks.

piasysdev-strings-failing-request.txt

PaoloPia avatar Sep 28 '23 15:09 PaoloPia

@PaoloPia - we identified an internal issue that affected that tenant. The issue should be resolved. We have also added a fix to ensure this does not affect other tenants in the future. The tenant that you were on was moved from one farm to another and the old DNS entry was cached. That caused a request from the CDN to be cached which was actually a failure.

Please confirm that the issue was resolved, or let us know if it is still a problem.

GrahamMcMynn avatar Sep 29 '23 20:09 GrahamMcMynn

@GrahamMcMynn Can you fix this for us as well. We are in urgent need of a fix. TenantName : goteborgonlineqa

image

image

spdavid avatar Sep 30 '23 08:09 spdavid

Hi @GrahamMcMynn thanks for the prompt feedback. Yesterday it did work for a while, even if I had to republish the SPPKGs in the AppCatalog. However and unfortunately, today the error is back. I'm sorry.

PaoloPia avatar Oct 01 '23 09:10 PaoloPia

Now it works again, JFYI. Hopefully, it will now be stable. Thanks. And after something like 1h now it is not working anymore, again. :-(

PaoloPia avatar Oct 03 '23 07:10 PaoloPia

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

ghost avatar Nov 13 '23 18:11 ghost