Closed jhholm closed 5 years ago
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Did you bundle & package your projects with the --ship
or -p
flag?
One difference between a debug & production build is that the debug build doesn't rewrite the URL, it assumes the files are coming from your local webserver.
I'm pretty sure I did and I retested just in case, no change. I'm also using https://github.com/SharePoint/sp-dev-solutions/releases - PnP Modern Search latest release package. I reckon it should be configured properly by looking at the config files. Both my own and that modern search webparts are loading from SharePoint. Using SPFx 1.8.2.
@jhholm said:
are loading from SharePoint
What are you referring to when you say this? You haven't provided the exact URL that you are seeing and what you expect it to be which makes it hard to fully understand your solution.
Just to be sure. I created a new SPFx 1.9.1 webpart and bundled and packaged it with --ship flags. Added that webpart to the landing page on a fresh team site.
The JS-file is loaded by the browser from the following URL: https://MYTENANTHERE.sharepoint.com/sites/apps/ClientSideAssets/7e1276e5-190e-43f3-8e92-4c4a1912964c/hello-world-web-part_c3cd8ef80cc9e8c67961745458adf848.js
Checking via postman, and using the correct Referer header, I can get the JS-file loaded via the following URL: https://publiccdn.sharepointonline.com/MYTENANTHERE.sharepoint.com/sites/apps/ClientSideAssets/7e1276e5-190e-43f3-8e92-4c4a1912964c/hello-world-web-part_c3cd8ef80cc9e8c67961745458adf848.js
So what is happening is that the webpart is not loaded from CDN right now, even though it actually can be loaded from there manually.
NOW I understand... thanks.
This sounds more like a system issue or a config issue with your tenant. You say you've enabled the CDN, it says the CDN is enabled on the origins, but the URL rewriting isn't happening. Can you share the results of the allowed origins for the site collection listed above when you request it using the POSH / Office 365 CLI commands?
If the configuration is correct, that's not something we're going to be able to investigate/address here in this list (which is for dev issues). My recommendation is to open a ticket via your SharePoint admin center to report the issue.
Using the default configuration in my development tenant /MASTERPAGE /STYLE LIBRARY */CLIENTSIDEASSETS
I've tested this with a few different tenants / customers right now in North Europe. Successfully used CDN for a longer time on classic sites and I remember this working at some point. I was hoping that, as this seems to look like a system issue, it would be possible to find a target for a fix here easier than from regular admin center tickets.
I'll continue via admin center then.
This issue list is for development issues. Unfortunately, there's zero that we can do here to fix the CDN if it's not working :-/
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
Category
Expected or Desired Behavior
SPFx Clientside solutions would be loaded from Office 365 Public CDN
Observed Behavior
SPFx Clientside solutions are not loaded from Office 365 Public CDN
Steps to Reproduce
I've tested this with a few tenants now: An older tenant and a fresh development tenant. SPFx JS files are still loaded after a 3 day waiting period from SharePoint instead of Office 365 CDN. The files are located in the CDN, but any URL rewrite is not happening.
Bug or outdated documentation?