Parsing failed after axios successfully read the local json file.

parsing failed after axios successfully read the local json file

export function getEmojiData() {
  return axios({
      method: "get",
      url: "/static/emojiDB.json",
      responseType:"json",
      // transformRequest: [function (data, headers) {
      //   // Do whatever you want to transform the data

      //   return JSON.stringify(data);
      // }],
    })
    .then(function(res) {
      return Promise.resolve(res.data);
    });
}

   getEmojiData().then((res)=>{
       console.log(typeof res)
       console.log(res);
       console.log(JSON.parse(res))
       })

Mar.02,2021

in JSON data, only " (double quotes) is allowed, and ' (single quotes)!
error message is also obvious. You can replace all single quotes in local json files with double quotes (note in English)


<
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b2f0-2c27a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b2f0-2c27a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?