\"JSON Parse error: Unrecognized token\'<\'\" Error is showing while hitting the api. Code is attached below Note* : Response is in the JSON format.
I fixed this problem my changing the multiline URLs in template literals to single-line URLs.
I had this problem on iOS, but not Android. The "same" code according to version control, and state according to testing procedures, led to this error on the iOS device emulator but not the Android device emulator.
Apple and Windows use different line endings, which is important considering template literals allow multiline strings.
// failed in iOS
fetch(`https:///
?param1=${param1}
¶m2=${param2}`);
// consistently works
fetch(`https:///?param1=${param1}¶m2=${param2}`);