nuxt: Fetch and AsyncData not working on reloading page.
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’.
<div align="right">This question is available on Nuxt.js community (#c998)</div>About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 5
- Comments: 15
fetch and AsyncData only work on vue in pages directory
so I still do not know how to solve this problem…
Its my solution add like plugin. Don remember set variable like false in data()
this mixin call asyncDate