angular: Angular http client not working with translation on in IOS chrome browser
🐞 bug report
Description
I have angular project built in angular 10. I am getting issue in calling api from IOS chrome browser when i turn on google translation from browser.
If i do not turn on translation it is giving me correct response for API
However when i turn on translation i am getting this error.
InvalidAccessError The object does not support the operation or argument
Error is happening only when i do translation from browser if i do translation from settings in Iphone the it is working fine.
and it is also working fine in all browsers in laptop.
If use javascript fetch function instead of angular HttpClient then it is working fine with HttpClient request is not even going to server. It is giving error even before sending request.
I tried to reproduce same issue in stackblitz but if i create any app on stackblitz than translate button is disabled there. You can see this stackblitz app created by me - https://angular-9-starter-gf561h.stackblitz.io/
You can see in stackblitz this trnaslate
option in dislabled. but it is enabled in my local app. And once i click on that button than httpClient stops working
To Regenerate issue
- Install latest angular app
- add any httpClient service in app
- run app and open in. Iphone chrome
- Api call will stop working after clicking on translate button in IOS chrome.
🔬 Minimal Reproduction
🔥 Exception or Error
🌍 Your Environment
Angular Version:
10.0.0
Anything else relevant?
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 15
- Comments: 19 (7 by maintainers)
Any workaround for this bug, even though it is caused by chrome ios? Or are there a angular fix for this as well?
Edit: I added this to my index.html file just to see if it works and indeed it seems to work. The code is from chrome’s ios fix linked above.
I have only seen this on error on these clients:
You can reproduce it using the Getting Started repo. I forked the repo, recreated the lock file using node 16, then deployed using Vercel. On Chrome iOS 15.5 I went to https://angular-getting-started-xi.vercel.app/welcome, translated to some language, then clicked on “Product List”.
If I don’t translate, I get the list of products.
Site: https://angular-getting-started-xi.vercel.app/welcome Repo: https://github.com/teug91/Angular-GettingStarted
also experiencing this with the latest angular version, using IOS + Chrome
@petebacondarwin , I checked ti today with native
XmlHttpRequest
request. NativeXmlHttpRequest
is working event after translation in IOS chrome, while AngularHttpClient
is not working.+1 still happening it seems (iOS 14.8 with Google browser)
This chromium bug has been confirmed and fixed. What caused this bug is that:
Although the chromium bug has been fixed, but for previous iOS chrome, it still exists. Is it good to send a PR to add a true async parameter for
XMLHttpRequest.prototype.open
method in Angular ?The same issue occurred in my app. Disabling of translate extension and everything works fine. IOS + Chrome. I tried only Angular HTTP client.