Starman
Starman
KKinde
Created by Starman on 12/13/2023 in #💻┃support
Unexpected Character Error with KindeSDK in Expo/React Native
Great, thanks. Could you please notify once it merges.
29 replies
KKinde
Created by Starman on 12/13/2023 in #💻┃support
Unexpected Character Error with KindeSDK in Expo/React Native
@Andre @ Kinde
29 replies
KKinde
Created by Starman on 12/13/2023 in #💻┃support
Unexpected Character Error with KindeSDK in Expo/React Native
@onderay04 where you able to replicate the error using the poc repo shared by @thijmen96 ?
29 replies
KKinde
Created by Starman on 12/13/2023 in #💻┃support
Unexpected Character Error with KindeSDK in Expo/React Native
This is basically my setup
29 replies
KKinde
Created by Starman on 12/13/2023 in #💻┃support
Unexpected Character Error with KindeSDK in Expo/React Native
29 replies
KKinde
Created by Starman on 12/13/2023 in #💻┃support
Unexpected Character Error with KindeSDK in Expo/React Native
@thijmen96 how long had you been using the sdk on your specific project before the error happened? For me it was about 5 days.
29 replies
KKinde
Created by Starman on 12/13/2023 in #💻┃support
Unexpected Character Error with KindeSDK in Expo/React Native
Great, let me know if you need anything like dependency versions or further code snippets.
29 replies
KKinde
Created by Starman on 12/13/2023 in #💻┃support
Unexpected Character Error with KindeSDK in Expo/React Native
🤔 That is odd. I am surprised that we are seemingly the only people having this issue.
29 replies
KKinde
Created by Starman on 12/13/2023 in #💻┃support
Unexpected Character Error with KindeSDK in Expo/React Native
502 makes sense. I am starting to get to the point where I too think that it is not necessarily my code. For me it happened over night, meaning that it was working one evening, and then on the next morning it wasn’t. How about you? Did it also happen ‘overnight’? Just wanting to check, are you also using react native, and if so expo?
29 replies
KKinde
Created by Starman on 12/13/2023 in #💻┃support
Unexpected Character Error with KindeSDK in Expo/React Native
@Andre @ Kinde sorry to bother you. Incase anyone is working on this issue, I just wanted to let you know that I double checked my entire flow, and ensured all keys were correct. I also at first though that there might be a problem with my global auth context but this was not the case either. Is there any other information that you require?
29 replies
KKinde
Created by Starman on 12/13/2023 in #💻┃support
Unexpected Character Error with KindeSDK in Expo/React Native
Hey @peteswah When using the code that Andre provided I am still getting the same warning:
WARN Possible Unhandled Promise Rejection (id: 0):
SyntaxError: JSON Parse error: Unexpected character: <
SyntaxError: JSON Parse error: Unexpected character: <
WARN Possible Unhandled Promise Rejection (id: 0):
SyntaxError: JSON Parse error: Unexpected character: <
SyntaxError: JSON Parse error: Unexpected character: <
I attempted to check what the value of the token is, but this was unsuccessful:
const handleSignUp = async () => {
try {
const token = await client.register();
console.log("Token from sign up:", token);
if (token) {
setIsAuthenticated(true);
setToken(token);
}
} catch (error) {
console.error("Error during sign up:", error);
}
};

const handleSignIn = async () => {
try {
const token = await client.login();
console.log("Token from sign in:", token);
if (token) {
setIsAuthenticated(true);
setToken(token);
}
} catch (error) {
console.error("Error during sign in:", error);
}
};
const handleSignUp = async () => {
try {
const token = await client.register();
console.log("Token from sign up:", token);
if (token) {
setIsAuthenticated(true);
setToken(token);
}
} catch (error) {
console.error("Error during sign up:", error);
}
};

const handleSignIn = async () => {
try {
const token = await client.login();
console.log("Token from sign in:", token);
if (token) {
setIsAuthenticated(true);
setToken(token);
}
} catch (error) {
console.error("Error during sign in:", error);
}
};
I might be using the log statement incorrectly here, which could explain that there is no value being logged, or it could be some other reason.
29 replies
KKinde
Created by Starman on 12/13/2023 in #💻┃support
Unexpected Character Error with KindeSDK in Expo/React Native
Great. Thanks 🙏
29 replies
KKinde
Created by Starman on 12/13/2023 in #💻┃support
Unexpected Character Error with KindeSDK in Expo/React Native
Hey @Andre @ Kinde , Thank you very much for your response. The structure that you recommend is the way that I had set it up initially. 'response.json()' was a desperate attempt to force a json response which had no effect due to the reason you mentioned. Just to double check, I did change it back to that original structure(i.e. the structure you recommend) but I am still facing the same issue. Could there perhaps be a problem where the Kinde backend does not accept my request, deeming it invalid and responding with a 404 or 403 error page, which would explain the possibility that HTML or JSX is being sent in response?
29 replies