Open dho-caissa opened 4 years ago
Thanks for the effort for the demo project. I tried the demo project, but I hit the error in the very first step, i.e. Run "NPM install and Yarn install". Any suggestion to unblock here and I can move forward then?
hi @xiaochunms, try run "NPM install" first. Then, run "yarn install". thanks
@dho-caissa I got following error when run "yarn install". :(
@xiaochunms I think NPM install should be enough to get the javascript packages. You don't need to run the "yarn install" if you don't have yarn installed. The main code to demo the behavior is here. The code simply calls the API and it is relatively straight forward. thanks again. https://github.com/dho-caissa/ExcelAddinDemo/blob/master/src/Caissa.ExcelAddin/CustomFunctions/src/functions.ts "function getFundMarketValueFail" calls api that takes more than 60 seconds. It fails with "Network Request Failed" error.
@xiaochunms is there any update? Any suggestion? Thanks
Hi, Is there any update on the 60 seconds timeout rule? We tested Fetch and XmlHttpRequest with the Microsoft sample project (link below). When API takes more than 60 seconds, both methods call failed. thanks
https://docs.microsoft.com/en-us/office/dev/add-ins/excel/custom-functions-web-reqs
@xiaochunms, @RuoyingLiang do you have any update on this? It is really causing us problems.
The issue is under investigating. @shaofengzhu , could you help to update the thread once there are more information?
@shaofengzhu could you please let us know if there is an update on this?
Thanks for adopting custom functions! I am sorry to see you've had an unresolved issue for such a long time.
Before I investigate any further, please take the following steps, and let me know of the outcome:
The argument is the number of milliseconds the function will delay the reporting of its result. So you'll have to wait for at least 2 minutes for all of them to finish.
Please report here what happens after 2 minutes.
Thanks, Zlatko
This issue has been identified as a hard-coded timeout in our JavaScript HTTP client. Work in progress to increase this limit, or make it configurable.
@zlatko-michailov (мерси много!) thank you so much for looking into this!
I ran the functions with the 4 parameters you suggested and they all returned 42 as shown on the screenshot. I am not sure if they are making HTTP calls to a server, or the specified delay is completely happening on the client, because the issue we are experiencing with functions that make HTTP calls that take more than 60 seconds.
@pbl2108, it's my pleasure to help you adopt custom functions.
My add-in is very simple. It only leverages the core custom functions pipeline. I wanted to prove that the pipeline has no time limit.
@JunielKatarn is from the team that owns the networking API on top of the ReactNative runtime. He'll take it from here.
Alternatively, you can also try a "shared runtime" which uses a real browser. See if it has the same issue. All you have to change is add an element to your manifest as described here: https://docs.microsoft.com/en-us/office/dev/add-ins/reference/manifest/runtime. You can see an example here: https://github.com/OfficeDev/custom-functions/blob/master/addins/upgrade/upgrade_shared.xml
I'll keep monitoring this thread in case something related to the pipeline comes up.
Thanks again @zlatko-michailov!
We tried the shared runtime at some point and we were not able to get it working successfully. I am not sure if the issue we ran into was the same limitation of 60 seconds, or something else. We will try again.
Excel functions defined with the JavaScript API are very powerful, and we have been using them since the early versions when they became available.
@JunielKatarn please keep us posted on the progress of removing the 60s limit or making it configurable, as this is the preferred solution for us.
@pbl2108 I have developed and submitted a fix in our JS runtime. It should be available in the next monthly Office update.
The timeout will be settable using XMLHttpRequest.timeout.
That's great news @JunielKatarn! Thanks for addressing the issue. We will be on the lookout for the update.
Any updates on this!?
This issue was fixed over a year ago. Feel free to close.
It is not fixed at all.
Using either fetch
or XMLHttpRequest
which both have default timeout set to 0 (no timeout) will timeout within 60 seconds. Excel is doing something under the hood that create this behaviour.
I don't know if it is intended or not but judging by maintainers comments I'd say no.
The consistent and simple workaround is to set manually your HTTP Client Timeout to something higher than 60 seconds and NOT to 0.
Simply check XMLHttpRequest timeout documentation
A similar behaviour is possible with fetch
api, just google it.
It would be great, even if it's unintended, to have it documented somewhere in Office add-in docs.
Thanks for your work.
@sboudouk can you please share the Office/Excel version you are using?
Sure.
Excel for Mac with a 365 subscription, version 16.64 (22081401)
Similar behaviour can be observed on latest versions of Windows / Office 365 Web.
To reproduce, just setup any server that answer after 60s + and request it from a shared runtime custom function through fetch
or XMLHtttpRequest
. I can share my very basic Express server that I use for test if needed.
Excel for Mac with a 365 subscription, version 16.64 (22081401)
I drove the Windows implementation only. Office uses React Native for its JS framework. The macOS version of the HTTP module is completely separate from the Windows one.
I'll reach out to the team owning the macOS variant.
If you also notice this on Windows, would you kindly also obtain that version number? I'll try to reproduce this behavior on my end.
Same issue on Windows, Microsoft 365 MSO Version 2207 Build 16.015427.20182 64-bit
Same issue on Windows, Microsoft 365 MSO Version 2207 Build 16.015427.20182 64-bit
This version contains the fix that makes the low-level HTTP client timeout configurable, with a value of 0
meaning not timeout.
But, we have found a hard-coded 60 second timeout for CORS preflight requests (not the actual final request).
However, this would not behave as you described (the manual timeout would not override this value):
The consistent and simple workaround is to set manually your HTTP Client Timeout to something higher than 60 seconds and NOT to 0.
We verified the lower-level components' timeout behavior, and setting it to 0
does succeed for regular (non-preflight) requests that take longer than 60 seconds.
Follow-up actions on our side:
Thanks, great actions. I'm sure this will help the next ones facing this issue.
Facing the same issue on Microsoft for Excel for Mac v16.71 (23031200).
Works all good using excel online.
Using fetch
to make API calls.
This is affecting our production excel add-in.
Would be very helpful if you have any updates / solution on the same?
This still seems to be an issue in Word for Mac as of Jan, 2024! @JunielKatarn , any way to learn more about progress on this?
@b-g-d I am not involved in Word for Mac development. The issue I worked on for Custom Functions was specific to Excel for Windows.
@shaofengzhu can you please help us route this issue?
Hi, is there progress on this issue? I'm developing an Excel add-in on Mac Ventura 13.4 (22F66), Excel Version 16.84 (24041420), this is a major limitation. Would greatly appreciate this being addressed.
This has also become a pressing issue for us, we are developing an excel add-in using react and are having our requests time out after 60s. Mac OS Sonoma 14.4.1 Version 16.85 (24051214) Microsoft 365 Subscription
Current Behavior
The excel custom functions created as part of Add-In seem to have 60 seconds request limit on API call. When API call takes more than 60 seconds, it return "Network Request Failed" error. We are experiencing this 60 seconds request time limit in our current production Excel Add-In. Is there way to change it in Excel or Excel Add-in?
Steps to Reproduce, or Live Example
To demonstrate the 60 seconds timeout behavior, we created a demo project with two custom functions. One function calls a data service that takes 70 seconds to complete. The other function calls a data service that takes 5 seconds to complete. The first function failed with "Network Request Failed" error. The code for demo project can be found here. The readm.md has instructions how to run it. https://github.com/dho-caissa/ExcelAddinDemo. The excel custom function seems have a timeout limit on fetch() call.
Demo code to show the behavior: ` try {
;`
Your Environment