UnhandledPromiseRejectionWarning: Error: Request failed with status code 404
See original GitHub issueGetting this verbose error warning on my terminal spilled over countless times in between all processes. I decided to do “git checkout master” changing the code in the folder while the server was running and watching for changes. This created an unhandled warning that doesn’t want to disappear. I downloaded and reinstalled everything from git and also restarted the computer, cleared yarn/npm caches but the error still occurs.
I found that in future versions Node will crash instead but for now these will actually stay indefinitely. I was reluctant to post here, although it’s important to notice that I’m not using Axios directly, a third party is, but all the solutions I find seem to address direct usage of Axios where they have direct access to the code.
How can I solve this without having any access to the code that created the error? Since this seems to be caused by not having a failure handler .catch() or a try/catch I imagined it could actually be part of an actual unhandled error inside the Axios codebase.
Error
(node:2585) UnhandledPromiseRejectionWarning: Error: Request failed with status code 404
at createError (/Users/masserra/Desktop/shopify/themes/ck-slate/node_modules/axios/lib/core/createError.js:16:15)
at settle (/Users/masserra/Desktop/shopify/themes/ck-slate/node_modules/axios/lib/core/settle.js:18:12)
at IncomingMessage.handleStreamEnd (/Users/masserra/Desktop/shopify/themes/ck-slate/node_modules/axios/lib/adapters/http.js:201:11)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
(node:2585) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 16)
Environment:
- Axios 0.18.0
- OSX 10.15.1
- @shopify/slate-tools ^1.0.0-beta.19
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:13
Top GitHub Comments
Simply update the return Axios code in the slate-analytics/index.js file.
node_modules/@shopify/slate-analytics/index.js
Update the code in line 95
return axios('https://v.shopify.com/slate/track', axiosConfig).catch(() => {});
Yeahhh! Cheers @deepp2887 !! Can’t believe, no more chaos!