axios: Have issues Network error on IOS 11 & 12

Describe the issue

Axios.get() not working on IOS 11 & 12 and I got issues: 1. {"name":"Error","message":"Network Error","stack":"createError@http://10.124.3.25:3001/static/js/0.chunk.js:4802:24\nhandleError@http://10.124.3.25:3001/static/js/0.chunk.js:4297:25"} 2. {"name":"TypeError","message":"Right side of assignment cannot be destructured","stack":"parseResponse@http://10.124.3.25:3001/static/js/2.chunk.js:511:63\npromiseReactionJob@[native code]"}

Example Code

const HttpInstance = (headers = null, baseURLDomain = null) => {
    class ApiConfig {
        constructor(enforcer) {
            if (enforcer !== singletonEnforcer) {
                throw new Error('Cannot construct singleton');
            }

            this.client = getClient(headers, baseURLDomain);
        }

        static get instance() {
            // Try to get an efficient singleton
            if (!this[singleton]) {
                this[singleton] = new ApiConfig(singletonEnforcer);
            }

            return this[singleton];
        }

        get(url, conf = {}) {
            return this.client
                .get(url, conf)
                .then((response) => Promise.resolve(response))
                .catch((error) => Promise.reject(error));
        }
    }
    return ApiConfig.instance;
};

export default HttpInstance;



export const getConversationApi = (eventId, time) => {
    const httpClient = HttpClient({
        authorization: `Bearer ${Config.TOKEN}`,
    });
    return httpClient.get(`chats/internal/${eventId}/${time}`);
};

Expected behavior, if applicable

Environment

Axios Version ^0.20.0 Browser Safari Node.js Version v13.7.0 OS: 11.3, 12.3.1 React 16.13.1

Additional context/Screenshots

https://user-images.githubusercontent.com/23132483/92897197-335fe780-f447-11ea-8f83-1da88a134ad6.png

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 16 (5 by maintainers)

Most upvoted comments

The above is not a fully testable example, I need something that is ready to run and gives me the same error then I can have a look.

Ok, please can you provide a detailed example to test this on?