We use aadHttpClientFactory from SP context in order to work with Azure App Service API . And it worked very well.
When I call Azure App Service API by using AadHttpClient I get the error in the browser console:
TypeError: Cannot read property 'call' of undefined
at o (listview-host-assembly_default_65e11fefa9767af7e7b350ea75aebfbd.js:19)
at o.t (listview-host-assembly_default_65e11fefa9767af7e7b350ea75aebfbd.js:19)
Sample code we use:
const aadClicent = await this.context.aadHttpClientFactory.getClient(""8dexxx-xxx-xxx-xxx"");
requestHeaders.append('Content-type', 'application/json');
const httpClientOptions: IHttpClientOptions = {
headers: requestHeaders
};
const response = await aadClicent.get("https://xxxxxx.azurewebsites.net/api/xxxxx/checkid/",
AadHttpClient.configurations.v1, httpClientOptions);
const json = await response.json();
if (response.status == 200) {
return json;
}
else {
return null;
}
It should be noted: this.context above is ExtensionContext
This code worked very well until 2019-10-29.
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
We get the same error when using MSGraphClient. It stopped working the last 2 hours.
this error happens with the aadHttpClientFactory as well as trying to get a token from the AadTokenProvider. Working fine from a WebPart but not in a CommandSet Extension (hence the listview related error).
Same issue here happening in 2 tenants. Our code was working fine before and nothing has changed.
Same issue reported here: https://github.com/SharePoint/sp-dev-fx-extensions/issues/265
Same issue. Our code was working fine yesterday (2019-10-29).
Same here. This bug is a showstopper to our Azure related services. It started already 2019-10-28.
It stopped working for us too, please fix this ASAP as it is causing major issues and most of the applications don't work. 🧯🔥
We are facing the same issue. Extension in view worked perfectly before.
I'm unable to repro... was the issue possibly temporary?
Network trace two demo web parts... one uses AADHttpClient & the other uses MSGraphClient...
We're still experiencing it and is consistent. We're getting it on list extensions using AADHttpClient.
Please provide the code you're using to call the client... the following code is working in multiple tenants I've tested, so I'm not able to repro this...
public getCurrentUser(): Promise<any> {
return new Promise<any>((resolve, reject) => {
this.context.aadHttpClientFactory
.getClient('https://graph.microsoft.com')
.then((client: AadHttpClient) => {
client.get('https://graph.microsoft.com/v1.0/me', AadHttpClient.configurations.v1)
.then((response: HttpClientResponse) => {
return response.json();
})
.then((jsonResponse: any) => {
resolve(jsonResponse);
})
.catch((error) => {
reject(error);
});
});
});
}
This is some test code. It's trying to call an Azure function secured by AAD. Framework is v1.9.0
public test(): Promise<any> {
const requestOptions: IHttpClientOptions = {
body: JSON.stringify({
SiteUrl: "http://blah.com",
Fullpath: "/something.doc"
})
};
return new Promise<any>((resolve, reject) => {
this.context.aadHttpClientFactory
.getClient("320xxx-xxx-xxx-xxx") //App Id
.then((client: AadHttpClient): void => {
client.post('https://xxxxxxx.azurewebsites.net/api/ValidateFilename', AadHttpClient.configurations.v1, requestOptions)
.then((res: HttpClientResponse): Promise<any> => {
if (res.status == 200) {
return res.json();
} else {
throw new Error("An error occured. Please try again");
}
})
.catch(err => {
reject(err);
});
});
});
}
I've also been able to repro using this /me graph call in a fresh Yeoman helloworld listview customiser (v1.9.1) so not sure if it's tenant specific? It's occuring in both our O365 developer tenant and production tenant.
Please provide the code you're using to call the client... the following code is working in multiple tenants I've tested, so I'm not able to repro this...
public getCurrentUser(): Promise<any> { return new Promise<any>((resolve, reject) => { this.context.aadHttpClientFactory .getClient('https://graph.microsoft.com') .then((client: AadHttpClient) => { client.get('https://graph.microsoft.com/v1.0/me', AadHttpClient.configurations.v1) .then((response: HttpClientResponse) => { return response.json(); }) .then((jsonResponse: any) => { resolve(jsonResponse); }) .catch((error) => { reject(error); }); }); }); }
What's the release configuration of the tenants, TR/SR?
Dev tenant is TR for all.
Production is TR for certain users - have tried for a TR and SR user and the same occurs.
I've just switched our dev tenant over to SR for all to see what happens - I assume this takes a while to have take effect so will report back once it does. Is there an easy way to tell if a user is seeing SR?
Dev tenant has now switched to SR and can confirmed the same issue exists whether SR or TR.
Same issue using fieldcustomizer on one of 3 tested tenants
sample code:
console.log is never hit instead error:
“listview-host-assembly_default_65e11fefa9767af7e7b350ea75aebfbd.js:19 Uncaught (in promise) TypeError: Cannot read property 'call' of undefined
at o (listview-host-assembly_default_65e11fefa9767af7e7b350ea75aebfbd.js:19)
at o.t (listview-host-assembly_default_65e11fefa9767af7e7b350ea75aebfbd.js:19)”
“https://spoprod-a.akamaihd.net/files/sp-client-prod_2019-10-18.025/listview-host-assembly_default_65e11fefa9767af7e7b350ea75aebfbd.js”
” https://spoprod-a.akamaihd.net/files/sp-client-prod_2019-10-18.025/listview-host-assembly_default_65e11fefa9767af7e7b350ea75aebfbd.js”
I noticed that we have the issue using both AadHttpClient and MSGraphClient with the latest version of SPFx 1.9.1. There is no issue when using older version of SPFx 1.7.0 on the same tenant.
I noticed that we have the issue using both AadHttpClient and MSGraphClient with the latest version of SPFx 1.9.1. There is no issue when using older version of SPFx 1.7.0 on the same tenant.
Strange I have a fieldcustomizer using 1.9.1 not working and a normal SPFx webpart also 1.9.1 which works on same tenant. Maybe it's just coincident that 1.7.0 works?
The SPFx which works is '"isDomainIsolated": true,' if that helps.
Another gues is that it my be related only to extensions. With a new fresh SPFx 1.9.1 webpart I have no issues using the graph client. I noticed the issue when using extensions.
Just tested with a fresh SPFx extension 1.9.1. The graph client is working on all pages except on list view pages. We have also field customizer not working on list view pages using the AadHttpClient. @andrewconnell you can try this scenario and you will get the same error.
I'm unable to repro... was the issue possibly temporary?
Network trace two demo web parts... one uses AADHttpClient & the other uses MSGraphClient...
As noticed @umaknow-jeanluc and @nmnikolov, it works with web parts, but doesn't work with extensions.
I added more details to reproduce the issue
We are facing the same issue in our environment. The PROD version of our app has not been updated for a few months and the solution stopped working 2 days ago.
AAD does not work for ListView extension.
Would it be possible to provide an estimate for a fix?
We are seeing the same behavior when using our Application customizer and list CommandSet.
Document library pages:
AadHttp requests throws "Cannot read property 'call' of undefined".
Script versioning:
https://spoprod-a.akamaihd.net/files/odsp-next-prod_2019-10-18-sts_20191031.001/splistitemsscope-is-mini-281ebb9f.js
It is working fine when viewed from a Site page.
Thanks everyone for your reports - we are actively looking into this.
I would also request anyone with a premier support case to open up the issue through that channel, so that it's getting properly tracked. We will provide updates also from here, but if you need to have updates directly from official support. Thx.
So, trying to get a repro of this as well. I've got a modern list w/ an app customizer and I've tried using the graph, as well as the code provided by zaiby, and it keeps working (good, but not so good for debugging).
Is this still happening for people? If it is, could you do me a favour and
1 - Click on the error to get to the line
2 - pretty print the listview-host-assembly.js file
3 - get a repro with the code around the error?
you might need to set a debug breakpoint and walk the callstack to get something useful. The problem I currently have is that the only function we so far is "call", and the callstack is o.t.
is there anything else that needs to be done to repro? Just hit the page? navigate around a bit?
My skills with browser debuggers are so-so, but I hope this helps
TypeError: Cannot read property 'call' of undefined
at o (https://spoprod-a.akamaihd.net/files/sp-client-prod_2019-10-18.027/listview-host-assembly_default_3842fe378afc1c7b2ed96df132049bde.js:19:50062)
at o.t (https://spoprod-a.akamaihd.net/files/sp-client-prod_2019-10-18.027/listview-host-assembly_default_3842fe378afc1c7b2ed96df132049bde.js:19:51286)
Additionally, I got this error (don't know if this is related, but because adal.js uses iframes, it may):
Blocked script execution in 'https://*****.sharepoint.com/_forms/spfxsinglesignon.aspx#error=consent_required&error_description=AADSTS65001%3a+The+user+or+administrator+has+not+consented+to+use+the+application+with+ID+%2767aa1c95-0664-45d4-bb6e-a338b2f930a5%27+named+%27SharePoint+Online+Client+Extensibility+Web+Application+Principal%27.+Send+an+interactive+authorization+request+for+this+user+and+resource.%0d%0aTrace+ID%3a+8fdcd984-674d-49cf-a4d7-ed6b3b3e1800%0d%0aCorrelation+ID%3a+3a12f432-025b-427b-8a14-00f8cc8fb5bd%0d%0aTimestamp%3a+2019-11-01+16%3a50%3a54Z&state=2a217ca1-6c73-4e17-a635-e30716f220fc' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.
As this is all Promises, call stack is quite short:
This is a premier support case - Rave case 17356013
Thanks folks. Have a repro, and teams are looking into it. Seems like an issue with how delay-loaded code chunks are being processed in the list experience. The http/adal chunk is downloaded over the network, but isn't getting correctly loaded into the app.
I'm, as the rest, hit by this bug. I am wondering if we could get a short update with regards to a possible bugfix? Greatly appreciated.
We are seeing this issue as well using the MSGraphClient.
This only happens to us when we load a document library first, not lists or other pages.
REPRO - Navigate directly to a document library, hit F5 to be sure, then try the graph call (in our case a header extension), it fails.
If we navigate to a list or another page first and try the graph call, it will work on that page. If we then use in-page navigation (by clicking on a left nav link, the page does an internal re-render to navigate) and then try in the doc lib, it still works.
If we load the doc lib first and nav to a list/other page using left nav (in-page navigation) it still fails.
If we load a list/other page first and DO NOT make the call, then in-page nav to a doc lib, it fails still.
Seems the call needs to be made to load in the required libraries before any in-page navigation occurs for it to work properly.
TypeError: Cannot read property 'call' of undefined
at o (listview-host-assembly_default_3842fe378afc1c7b2ed96df132049bde.js:19)
at o.t (listview-host-assembly_default_3842fe378afc1c7b2ed96df132049bde.js:19)
The list page seems to load in https://spoprod-a.akamaihd.net/files/sp-client-prod_2019-10-18.027/chunk.vendors~sp-http-adal_6a29bd503d1db27efc57.js
AFTER the first graph call is made. When loading a doc lib this call seems to be made on page load, without any graph calls being made.
Hope this helps!
Cheers!
Hi, also for one of our customer tenants we are seeing a custom doclib attached SPFX list view extension failing while trying to authenticate via oauth to an Azure api endpoint, starting 10/29. Any progress on resolving this one is very welcome.
Also hit with this bug in our production system. Premium support ticket done yesterday, but no more information got so far. It would be great to have some updates on this in order to help us to judge should we wait for the fix or make some workarounds around this.
OMG I was going crazy for few days trying to identify what was wrong while it did not change my code.
I hope this issue to be fixed very quickly because my SPFx extension is a critical feature for the company,
This issue is affecting three of our customers, a P1 for all of them... it's raised with premier but struggling to gain any information regarding potential timeframes for resolution. @patmill @VesaJuvonen it'd be great if you could share the resolution plan and possible timeframes? that way we can set expectations and manage accordingly. thanks, J
A solution for this problem is highly required as the issue makes all remote API calls impossible and therefore makes the whole application unusable.
I also don't see a real workaround. So, as @jaygoodison already requested: Please share your plan of how this should get resolved. Also, please share progress status more actively - so, that we can inform our customers.
The problem has hit our tenant and impacting our business, few workarounds did not succeed so far.
could this be prioritized and a bug fix be implemented please.
Any updates on this? This is having a big impact on work I'm involved with.
Also suffering by this issue for a week now, and have some partners who are really dependent on spfx listview command set for their work. This issue is present sience (first report for this we got on) 2019.10.31
Related code snipet:
Hope it will be resolved soon.
The fix is understood and being built. I will update this thread when it starts to roll out. Apologies for the delay.
< techdetails> The problem was that the list app loaded a version of sp-http and the extension loaded a version of it. Normally this works without a problem because the library is loaded via the sp-loader, and it makes sure that everyone shares a copy. In this case, the base app included it like a standard js library, and the loader wasn't involved. This normaly wouldn't be a problem either, except that a recent feature in the base list app started accessing the graph, which required a token, which required loading in the adal.js chunk for the sp-http package. The extension code also tried to do this, and the nature of the webpack / chunk / jsonp goop in the chunks collided, and only one load would work. In addition, the telemetry noticed a very slight dip in QOS, but that was hiding the failures because every list load that didn't have an extension that accessed token fetching was succeeding in the token fetch codepath. techdetails>
One more update from the team working on the fix. ETA is that it should be released by end-of-day today.
OK - fix should be rolled out.
Working for us, thanks
Working for our customers as well, thanks team and @patmill
Thanks for the fix. It works on our sites
No more "Cannot read property 'call' of undefined" on our part, thank you very much.
Thanks for the fix Team! Working for us too!
We have no more problems on this issue. Thanks a lot!
The issue with the MSGraphClient in Extensions is fixed for us as well.
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
Most helpful comment
Thanks everyone for your reports - we are actively looking into this.