I receive error on catch TypeError: relativeURL.replace is not a function
See original GitHub issueI try to save this data…
Each property is transformed in getters and setters by Vue.js
save () {
let scheduleRequests = []
self.schedule.forEach(it => {
scheduleRequests.push(self.saveEventSchedule({ // <-- VUEX ACTION
title: it.title,
tags: it.tags.map(it => it.id)
}))
})
return axios.all(scheduleRequests)
.then(results => {
self.vm.schedule = results.map(r => r.id)
return self.saveEvent(self.vm) // <-- VUEX ACTION
.then(resolve)
.catch(reject)
})
.catch(reject)
}
In my actions …
saveEvent ({ commit }, event) {
return events.post(event)
.then(resp => {
return resp.data
})
.then(resp => {
commit(ADD_EVENT, resp)
return resp
})
}
saveEventSchedule ({ commit }, eventSchedule) {
return eventSchedule.post(eventSchedule)
.then(resp => {
return resp.json()
})
.then(resp => {
commit(ADD_EVENT_SCHEDULE, resp)
return resp
})
},
And I receive this in catch
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
relativeURL.replace is not a function error in Next.js
I believe this is caused by your use of axios and have nothing to do with Next.js. The method axios.get only takes string...
Read more >I receive error on catch TypeError: relativeURL ... - Bountysource
I receive error on catch TypeError : relativeURL.replace is not a function.
Read more >Uncaught TypeError | Is Not A Function | Solution - YouTube
Have you encountered an error like:- Uncaught TypeError - Some selector is not a function - jQuery is not a function - owlCarousel...
Read more >Import Axios results in Uncaught SyntaxError: Invalid regular ...
I'm currently building a website where i'm using Laravel Mix to compile all my assets through Webpack. It's not a Laravel project, but...
Read more >URL() - Web APIs - MDN Web Docs - Mozilla
If url is a relative URL, base is required, and will be used as the ... Raises a TypeError exception as '/en-US/docs' is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I meet this problem. Because I add parameter [method post] in axios.post function. Hope it helps someone.
If
events
andeventSchedule
are axios instances, you need to pass the url as the first parameter: