I get this error and do not know what the deal is...
Fetch API cannot load http://localhost:3001/lob/delete/32c10308 Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The response had HTTP status code 404. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
undefined:1 Uncaught (in promise) TypeError: Failed to fetch(…)
Just for some context here is my react code in my action:
export function deleteLob(lobid) {
return function(dispatch) {
dispatch({ type: types.IGNITE_LOB_DELETE, lobid })
fetch(${config.SERVER_PREFIX}lob/delete/${lobid}, {
method: 'DELETE'
})
.then(function(response) {
if (response.status >= 400) throw new Error("Bad response from server")
//TODO: notification
I get this error and do not know what the deal is...
Fetch API cannot load http://localhost:3001/lob/delete/32c10308 Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The response had HTTP status code 404. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled. undefined:1 Uncaught (in promise) TypeError: Failed to fetch(…)
Just for some context here is my react code in my action: export function deleteLob(lobid) { return function(dispatch) { dispatch({ type: types.IGNITE_LOB_DELETE, lobid }) fetch(
${config.SERVER_PREFIX}lob/delete/${lobid}
, { method: 'DELETE' }) .then(function(response) { if (response.status >= 400) throw new Error("Bad response from server") //TODO: notification