Recently, I encountered a puzzling error message:
vue-resource.common.js Uncaught TypeError: str.replace is not a function
while working on an ajax call to retrieve some data:
export default {
data: () => ({
recipes: []
}),
ready() {
this.$http.get('http://localhost:3000/recipes', {
headers: {
'Access-Control-Allow-Origin': true
}
}).then((recipes) => {
this.$set('recipes', recipes)
})
}
};
I am still new to vue.js and feeling lost on how to troubleshoot this issue... any guidance or tips would be highly appreciated.
Thank you in advance!