question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UnhandledPromiseRejectionWarning: Error: Request failed with status code 404

See original GitHub issue

Getting 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:

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:7
  • Comments:13

github_iconTop GitHub Comments

22reactions
deepp2887commented, Nov 25, 2019

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(() => {});

1reaction
masserracommented, Nov 27, 2019

Yeahhh! Cheers @deepp2887 !! Can’t believe, no more chaos!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Axios - [Unhandled promise rejection: Error: Request failed ...
404 simply means it couldn't find what you are looking for. Make sure to catch the failure and then send results of 404...
Read more >
unhandledpromiserejectionwarni...
unhandledpromiserejectionwarning : error: request failed with status code 404. Clear input field icon. Search query. Filter Icon. Recency.
Read more >
Axios: Request failed with status code 404 - Quasar forum
The 404 error means axios couldn't get the resource that it requested. That error is from the server though. So, it sounds like...
Read more >
Error Request Failed With Status Code 404 Axios React
Error Request Failed With Status Code 404 Axios ReactBut dropping the url matcher works: adapter. Webpack failed to load resource. api and ReactJS...
Read more >
Uncaught (in promise) Error: Request failed with status code ...
Generally this error comes when the url/location provided inside GET method is not correct. So check the url/location again and correct it. So...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found