bradtraversy / microposts_fullstack_vue

Full stack vue and express

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to compile.

opened this issue · comments

./src/services/historyService.js 19:20
Module parse failed: Can not use keyword 'await' outside an async function (19:20)
You may need an appropriate loader to handle this file type.

 return new Promise(function (resolve, reject) {
   try {
      var res = await axios.get(url);
     var data = res.data;
      resolve(data.map(function (history) {

Just simply make function async.

return new Promise(async (resolve, reject) => {...

Thanks