Azure CDN - related error while loading the web parts.
Hi, I have following error while loading SPFx webpart, I have some resources in Azure CDN but it fails to load the URL. It happens for few users not for everyone. I checked from Azure CDN side and it looks fine. Not sure what's causing the issue in SPFx webpart.
SPLoaderError.loadComponentError]: ***Failed to load component "5xxx-xxx-xxx-xx-5" (xxxxxWebPart). Original error: ***Failed to load URL 'https://xxxxxxxxx.azureedge.net/xxxxxxx/xxxxxxxx.min.js' for resource 'jquery' in component '5xxx-xxx-xxx-xx-5' (xxxxxWebPart). There was a network problem. This may be a problem with a HTTPS certificate. Make sure you have the right certificate.

Category
- [ ] Question
- [ ] Typo
- [x] Bug
- [ ] Additional article idea
Any suggestion on how I can resolve this??
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Have you verified the file is present in the CDN and accessible by everyone?
Have you isolated it to specific users, browsers, environments?
Do you have any special content restrictions on the CDN? For the users having issues, have you had them try to load the file directly using the URL to verify they can access it? Because it's a client-side request, if they can access it directly via the browser, SPFx's loader should be able to load it.
Yes, the file is available in CDN and the user can access it directly using the CDN url. Actually this issue not only happens to Azure CDN but also publiccdn (I have some other webparts in the page which doesn't have any content in Azure CDN).
After page refresh by a user, everything looks fine (all webparts load perfectly). This mostly happens when the users opens the site for the first time of that day and it doesn't happen to all the user but some.
OK... so it's not an issue with accessing the file... sounds like things work once the file has been cached on the user's machine.
Is it your web part bundle that's not loading, or a dependency?
In your OP it looks like it might be jquery... is that correct, or is it all JS files (including the component bundle)? If it's the dependencies, how are you loading them in your component? Do you have the right dependency chain setup?
I'm thinking this sounds like you might not and the web part bundle is loading before all dependencies are loaded on the page. It works the 2nd time because they are cached and they don't need to wait for them to load.
This issue also happens for other webparts which doesn't have any dependency. Ya, you are right I was referring to jquery and its referred in config/config.json -> "externals". The below attached screenshot is from another webpart. It seems webpart bundle itself not loading

Also we noticed this happens to the users in particular geo location.
Being no one else is reporting CDN issues like this, I'd open a ticket within your M365 portal. You say this happens to users in specific geo... that sounds like there are networking/connectivity issues there.
Closing this issue as "answered". If you encounter a similar issue(s), please open up a new issue.