Static GitHub Issues

[1133] Fetch and AsyncData not working on reloading page.

prev: asyncData reverting after data modified
next: extendRoutes doesn't work?
Error: Request failed with status code 404
    at createError (/home/deepak/Linux/NodeJS/FullStack/Notes/WebApp/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/home/deepak/Linux/NodeJS/FullStack/Notes/WebApp/node_modules/axios/lib/core/settle.js:18:12)
    at IncomingMessage.handleStreamEnd (/home/deepak/Linux/NodeJS/FullStack/Notes/WebApp/node_modules/axios/lib/adapters/http.js:191:11)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:188:7)
    at endReadableNT (_stream_readable.js:975:12)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)

I am fetching data via ajax using axios. When I navigate to the page using a router link, it loads the data but if I reload the page then data disappears and the above error shows up on the backend. It is same for both methods 'fetch' & 'asyncData'.

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c998">#c998</a>)</em></sub></div>