когда я использую $ ax ios. $ Get в asyncData,
async asyncData({ $axios }) {
const { list } = await $axios.$get('http://localhost:3000/api/list')
return { list }
}
терминал ubuntu всегда выдает ошибку вроде:
(node:9628) UnhandledPromiseRejectionWarning: Error: Request failed with status code 503
at IncomingMessage.emit (events.js:228:7)
at IncomingMessage.EventEmitter.emit (domain.js:475:20)
at endReadableNT (_stream_readable.js:1185:12)
at processTicksAndRejections (internal/process/task_queues.js:81:21)
(node:9628) 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: 6)
(node:9628) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
но когда я использую терминал в vscode, ошибка исчезла. Я смущен. (