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

Cannot retrieve XMLHttpRequest #355

Closed
73k05 opened this issue Jan 30, 2024 · 3 comments
Closed

Cannot retrieve XMLHttpRequest #355

73k05 opened this issue Jan 30, 2024 · 3 comments

Comments

@73k05
Copy link

73k05 commented Jan 30, 2024

Hi,

Thank you for this lib ,that seems amazing!

I installed nsw on Expo React-Native project and I had this error:

Cannot retrieve XMLHttpRequest response body as XML: DOMParser is not defined. You are likely using an environment that is not browser or does not polyfill browser globals correctly.

I'm using Axios to send the request:

// Headers to sent alongside request to Api
const HEADERS = {
  "Access-Control-Allow-Origin": "*",
  "User-Agent": USER_AGENT,
  "Content-Type": "application/json",
};
// Create Axios Instance based on API Url & Headers config
const axiosInstance = axios.create({
  baseURL: API_URL,
  headers: HEADERS,
});
axiosInstance
    .post("/auth/login", {
      email: credentials.email,
      password: credentials.password,
    })

The Handler is like this

export const handlers = [
  http.post(`${Config.apiUrl}/auth/login`, async ({ request }) => {
    return HttpResponse.json({ name: "73k05"});
  }),
];

I followed the RN tutorial excepted the index.js part, I put it in App.tsx If anybody face this issue I'd be please to talk about it

Thank you
73k05

@73k05 73k05 changed the title Error TextEncoder doesn't exist hermes Cannot retrieve XMLHttpRequest Jan 31, 2024
@73k05
Copy link
Author

73k05 commented Jan 31, 2024

This issue is linked to few things after having done some more researches

I'm closing because it is duplicated in a way...

@MarcHbb
Copy link

MarcHbb commented Sep 6, 2024

@73k05 Did you managed to fix it ? I have the same issue

@73k05
Copy link
Author

73k05 commented Sep 16, 2024

Hi @MarcHbb,

sadly no, we have just used this solution

The solution proposed to downgrade to v1 worked for me

Regards
73k05

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