Uncaught (in promise) Error: timeout of 5000ms exceeded

solve

Method 1: set Axios in main.js method 2: if Axios is encapsulated into request

In the process of doing the project, due to the large amount of data requested, the request timed out, so this error was reported. The timeout time of 5000ms was set when Axios was configured. We can solve this error by changing this setting

Method 1: set Axios in main.js

Set the timeout of Axios in main.js, but it is generally not available. You need to set it yourself. Then main.js can be found under SRC of your project, and add Axios. Default. Timeout = 50000 in it, which means that setting the timeout to 50 seconds should be enough

Method 2: if Axios is encapsulated into request

If the first method is not used at all, you can change it in another setting:

here

Read More: