Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOS and Android(old version) phone, UNKNOWN ERROR: undefined is not a function #16

Closed
skyshirt opened this issue Jan 24, 2018 · 19 comments

Comments

@skyshirt
Copy link

image
image

@skyshirt skyshirt changed the title IOS and Android phone, UNKNOWN ERROR: undefined is not a function IOS and Android(low version) phone, UNKNOWN ERROR: undefined is not a function Jan 24, 2018
@skyshirt skyshirt changed the title IOS and Android(low version) phone, UNKNOWN ERROR: undefined is not a function IOS and Android(old version) phone, UNKNOWN ERROR: undefined is not a function Jan 24, 2018
@gruhn
Copy link
Owner

gruhn commented Jan 24, 2018

Hey, thanks for reporting. Can you tell me which iOS version you're running. For your Android phone too including browser and browser version please.

@skyshirt
Copy link
Author

skyshirt commented Jan 25, 2018

ios iphone 6 10.x error
iphone 6s 11.2.2: ok
Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_2 like Mac OS X) AppleWebkit/604.4.7 (KHTML, like Gecko) Version/11.0 Mobile/15C202 Safari/604.1
android 5.1.1: error
Mozilla/5.0 (Linux; Android 5.1.1;NX510J Build/LMY47V) AppleWebkit/537.36(KHTML,like Gecko)Version/4.0 Chrome/42.0.2311.154 Mobile Safari/537.36)

@skyshirt
Copy link
Author

but when i use Chrome(62.0.3202.84) in android 5.1.1, it will be ok

@gruhn
Copy link
Owner

gruhn commented Jan 25, 2018

Do you always get that exact error message? This component generally doesn't work on iOS 10 and below (see #17) but I expected another error message 🤔

Can you show me the code line where the error occurs? I know the code is minified but if you turn on pretty print in the dev tools I hopefully can tell where is comes from.

@skyshirt
Copy link
Author

skyshirt commented Jan 26, 2018

android 5.1.1 & ios 10.x report the same error
image

@gruhn
Copy link
Owner

gruhn commented Jan 26, 2018

Thanks! The error is caught in the Promise callback. That's why you can handle it there. I need to know though where the error occurs inside the vue-qrcode-reader component. Sorry, I need you to find out where this error comes from. I can't reproduce it :S

  • go to the demo page
  • open the file I highlighted in the picture below
  • pretty print that file
  • find the startCamera function (this error must occur somewhere here)
  • set a debug breakpoint
  • reload the page
  • try to find the code line, where this TypeError comes from

bildschirmfoto vom 2018-01-26 12-23-00

@gruhn gruhn self-assigned this Jan 26, 2018
@skyshirt
Copy link
Author

yes, I know. but it's a pity that it's the same mistake
image

@gruhn
Copy link
Owner

gruhn commented Jan 27, 2018

Weird 😟 can you check if you have similar issues with this demo

@skyshirt
Copy link
Author

skyshirt commented Jan 28, 2018

This demo shows everything normal, without any mistakes in android 5.1.1

I think it seems that the browser incompatibility is caused by the packaged Babel configuration.
What do you think, my friend @gruhn ?

@gruhn
Copy link
Owner

gruhn commented Jan 28, 2018

I'm starting to think that too. I have no idea where to look though. I could try to upgrade everything Babel related and hope for the best

@gruhn
Copy link
Owner

gruhn commented Jan 28, 2018

Ok I did that, check the demo page again 🙏

@skyshirt
Copy link
Author

image
This error still exists

@gruhn
Copy link
Owner

gruhn commented Jan 29, 2018

hmmm... based on your previous screenshot I assumed the error occurred in "Line 1, Column 96626" but this looks different now. Your Chrome Dev Tools look a little bit outdated. Is there really no option to pretty print that file so I can tell where exactly this error comes from. Otherwise, can you update to latest Google Chrome? I'm poking around in the dark here without any further details.

@skyshirt
Copy link
Author

It must not be the problem of developing tools
I used it to debug Android 7 and it's normal.

@gruhn
Copy link
Owner

gruhn commented Jan 29, 2018

Ok, I just saw part of the error log in your latest screenshot states that the error occurs in column 147514. Based on that I found a piece of code that (I believe) belongs to webrtc-adapter:

bildschirmfoto vom 2018-01-29 04-32-31

find seems to be the function that is undefined here. I assume this is the same as Array.prototype.find which is confusing though because 3 code lines above, filter is not throwing an error although find is a much older array function.

Anyway, I upgraded webrtc-adapter so you can check the demo page once again. I'm not confident though, that this solved the problem. In case this is indeed a webrtc-adapter bug, I'd like to forward this issue to their repository. So can you please tell me again, which browser and browser version you are using on your Android 5.1.1 device ? I don't need the full user-agent string, I don't know how to read those properly. Just tell me if it's Chrome 42 or Firefox 25 or something.

@skyshirt
Copy link
Author

skyshirt commented Jan 29, 2018

image

Chrome 42 and Chrome 37

@skyshirt
Copy link
Author

skyshirt commented Jan 29, 2018

image
t = Array.prototype
another find at vendor.e850defec668ef010cd5.js:6:63938
Array.prototype.find support browsers
image

@gruhn
Copy link
Owner

gruhn commented Jan 29, 2018

Ok, I believe we're on to something. I was also wrong filter has been longer part of official JS than find.

@skyshirt
Copy link
Author

skyshirt commented Feb 2, 2018

All right. Understand what you mean, and thank you for your serious help.
This problem has been restored in the actual production environment.
Temporarily by testing whether to support Array.prototype.find to solve the problem.

@skyshirt skyshirt closed this as completed Feb 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants