Sharepoint Online every SPFx web parts get this error : Something went wrong -> Mismatched anonymous define() module - sharepoint-online

I have SharePoint online sites and some spfx web parts. These sites are created with publishing site templates and web parts have been working for months. I rarely got this error "something went wrong". When I refresh the pages then the error goes away. Every web part gets the same error. Even if I use an empty web part it gives the same error. But in last two weeks, that error increased a lot. Is there any update for publishing sites? How can I remove this error?
Something went wrong
If the problem persists, contact the site administrator and give them the information in Technical Details. TECHNİCAL DETAİLS ERROR: Mismatched anonymous define() module: function(e,f,d){"use strict"; function i(e,t)...
I redeployed the packages but nothing change.

Finally I found the cause.
I use a publishing portal site template with a custom master page. There are some javascript references in the header. When I removed references, the error has gone. The final solution is to add this code
<!--SPM:<SharePoint:Scriptlink language="javscript"
name="https://....js"
runat="server" Localizable="false"/>-->

Related

How do I fix this 'phishing' warning in my app deployed in vercel?

Hi people: I deployed my videogames CRUD in heroku + vercel and I'm getting a "phishing warning" like this one from every browser when I visit the site:
I tried redeploying the app with a different name but I keep getting this error as others do when they visit it.
This is my site: https://pi-videogames-nk.vercel.app/
Does anyone know what could be causing this? Thanks.
This is a warning triggered because your site has ended up in one of the Safe Browsing lists.
You can report the mistake here: https://safebrowsing.google.com/safebrowsing/report_error/?url=https%3A%2F%2Fpi-videogames-nk.vercel.app%2F
As for how it ended up be flagged... Could just be a false positive detection. As well as manual reports of malicious content, Google do some level of automated scanning.

ASP.NET Core 5 MVC web app returning bad request errors in some pages after deployment to IIS

I have tried everything. I configured Windows Server 2019 according to Microsoft documentation and I successfully deployed a .NET 5 web application to the IIS.
I can get to the login page. I can even get to the forgot password page and they show themselves fine. However when I try to do any action (send the forgot password link or login to the page) I get a "Bad Request" from the server. I haven't found a way to explain why.
I have tried several, and I mean several things found Googling around but nothing helps. This include disabling https within the .NET Core application, trying to get a detailed error page using the app.UseDeveloperExceptionPage(); instruction inside Startup, etc etc but nothing works. I always receive this page trying to execute any action:
If someone could help or point me into the right direction, I will really, REALLY appreciate it.
Thank you
PD: In case it has anything to do with the problem, the error, at least the two that I can reproduce (because I can't even log in), happens, I think (maybe don't) when redirecting to another page in Microsoft Identity.
EDIT: code was asked by one of you. Thank you.
As you see, there's nothing specific in the forgot password screen for my application. This is scaffold code from Microsoft Identity. I even edited it and just let one line of code inside it, which is the default return code anyway as follow:
public async Task<IActionResult> OnPostAsync()
{
return RedirectToPage("./ForgotPasswordConfirmation");
}
As you can see, there's nothing special with that code. Here's the html that calls it, again, is a scaffold of Microsoft Identity with little to no changes (by little, I mean, maybe some CSS and a new value of view data):
But then again, forgot password page actually shows and seems well in the front end, but immediately I try to enter my email and click enter in this page, (also, just a scaffold of Microsoft Identity):
Nothing happens. I receive the bad request. There's NO magic nor custom code here. Something silly is going on.
EDIT II: YES, locally it works perfectly. The strange behavior happens only when deployed to IIS.
EDIT III: I coded and enabled logging in my .NET Core APP and wrote that to a file, and I think I finally got, at least the error (not the reason yet):
But why?? Cookies are enabled in the server browser without avail, same issue. Someone has a better idea than disabling anti forgery rules to login and forgot password pages?
Thank you
For some reason, when I deployed the first version of my app into IIS, I thought it was a good idea to just browse it from the IIS link. Of course, in a new mounted Windows Server 2019, IE is still the default browser. I connected directly to the IP of my web app via VPN, but used Chrome this time. Guess what? All problems disappeared. Yes, it's a bad idea to try to use a modern framework like .NET Core Identity with IE.

Custom Webparts Randomly Fail to Load, Giving "n._internalInitialize is not a function" Error

I have created a number of webparts using React that I have deployed to the app catalog of a SharePoint Online site. When loading a page containing various webparts, I am randomly experiencing an issue when loading a modern page containing them. Sometimes all of the content loads fine, but other times, 1 or more of the webparts will fail to load. When they fail to load, I get the standard "Something went wrong" error with the following error and stack trace:
Something went wrong If the problem persists, contact the site
administrator and give them the information in Technical Details.
ERROR: n._internalInitialize is not a function
CALL STACK:
mwqp/ie</e.prototype._initializeWebPart#https://spoprod-a.akamaihd.net/files/sp-client/sp-pages-assembly_en-us_699158f7fea868eb081b869967788f85.js:1:1713443
mwqp/ie</e.prototype.loadWebPart/<#https://spoprod-a.akamaihd.net/files/sp-client/sp-pages-assembly_en-us_699158f7fea868eb081b869967788f85.js:1:1705013
I am not sure how to resolve this issue and would appreciate help. There is nothing in the developer tools console that provides any additional information about this error. The only errors present are errors that are also present when all of the webparts do load successfully. These errors are:
Content Security Policy: The page’s settings blocked the loading of a
resource at inline (“script-src”). onloadwff.js:71:799505 Uncaught
ReferenceError: exports is not defined
/_layouts/15/activitymonitor.js:25
I have a git repo containing the code for one of the simplest webparts that this occurs with: https://github.com/kbroskie/spfx-welcome-message
Edit to add more information:
This occurs regardless of whether or not my cache has just been cleared. It occurs irrespective of browser, but I do tend to encounter this error more often on browsers other than Chrome. There are no 404's in the network logs.
This doesn't occur just after deploying an sppkg. It occurs with sppkgs that haven't been updated recently, as well as those that have.

azure 502 bad gateway

has anyone seen this before so I am getting a 502 bad gateway error on my app, the issue I have is that the detailed error information I am getting says my requested url is https://SOX:80/api however my site is configured to use https://sox.domain.com and the site largely works pulling the various JS files required
my app service name is SOX in the azure dashboard so I assume that is where it is picking up SOX from but I have no idea why it is using this.
So overall the issue had me perplexed... however with more testing I soon figured out what was going on.
my backend is Dotnet core Azure throwing the 502 bad gateway was its way of handling exceptions ultimately the problem was code based.
I am mentioning this purely so that it will help others
my first issue was based on cert handling it seems dotnet runs in a container that is specified by your app name as i mentioned above https://SOX:80
the below was causing my issues
sslPolicyErrors = X509StoreStoreHelper.ValidateSSLPolicy(cert.Thumbprint, cert);
after commenting this out for testing my problem went away(we are putting in a proper fix )
my second issue came from using an unsupported view in Azure SQL master.sys.master_files which again just threw a 502 bad gateway error referencing https://SOX:80
please note I have used https://SOX:80 as a reference to mask the real site.
hope this helps the next person.
Based on your description, I have checked your site (https://sox.azurewebsites.net/) and found that it contains three static files (index.html,generic.html,elements.html). I viewed your website in Chrome incognito window as follows:
I did not find any requests against https://SOX:80/api in your html page or JavaScript files. Please try to access your website in a new incognito window to isolate the cache issue or just press CTRL + F5 to refresh your current page to narrow this issue. Moreover, you need to check whether you have configured URL Rewrite. If you still could not solve this issue, you need to update your question with the details for us to reproduce this issue.

SharePoint login page doesn't seem to load styles from /_layouts, throws error "value cannot be null"

I have a custom login page for WSS 3.0 using forms-based authentication. It uses the simple.master masterpage provided in /_layouts, so when I go to my login page I expect to see the blue and yellow screen surrounding some branding and login components. This happens sometimes. On the other hand, sometimes I go to the login page and none of the styles are there; it just displays my login components against a white background. If I try to log in (whether with a valid or invalid login) I get:
Value cannot be null.
Parameter name: value at System.String.EndsWith(String value, StringComparison comparisonType)
at Microsoft.SharePoint.ApplicationRuntime.SPRequestModule.PostAuthenticateRequestHandler(Object oSender, EventArgs ea)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
This null is not happening in my custom login code, it's within the SharePoint APIs. I've looked at them with Reflector and I believe that this exception is the result of not being able to load something within the client-side resources, which is strange but apparently the case.
The issue happens intermittently. iisreset or recycling the app pool does not seem to make it go away, but sometimes it seems to just fix itself for an hour or so. I have seen some references to this problem on the web but none of the solutions mentioned have worked for me. It's easy to think you've solved this problem because of its tendency to suddenly go back to normal for a while.
I've checked the directory permissions and the app pool identity can read /_layouts and its subfolders.
Thanks.
Update: I have some reason to believe, but little ability to test, that this happens when you copy a web.config wholesale from one server to another.
The issue appears to be the fact that a web.config in the layouts directory has batch compilation set to false.
I had the same issue. The web.config in C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS contained this line:
<compilation batch="false" batchTimeout="600" maxBatchSize="10000" maxBatchGeneratedFileSize="10000" />
The line should read:
<compilation batch="true" batchTimeout="600" maxBatchSize="10000" maxBatchGeneratedFileSize="10000" />
For more information:
Fixing the Elusive “Value Cannot Be Null” FBA Authentication Error
UPDATE 11/30/2009: FYI. It appears that this doesn't actually fix the issue, but it appears to expand the time between errors.
Have been having the same kind of error with FBA, just found a blog post indicating that it could be an issue with the way the SPWebApplication.Lookup() function works.
The short version is: it seems that you need to specify the correct host header value (that match your zones) in IIS if you have manually created or changed the IIS web site.
Here is the relevant blog post for reference.

Resources