[Vuejs]-TypeError: res.response is undefined

0👍

✅

You’re running into a CORS error which means that the server you’re making a request to is not allowing requests from your client domain. If you own the server you’ll need to add your domain to the list of allowed domains, or if this fails, check that the request method “POST” is allowed.

It looks like you’re then getting the ‘res.response” error as when the error gets caught in the error function, it’s returning an error message which doesn’t have a “response” property. Try console.log’ing the “res” response to see what it’s giving you and adjust the property you’re using from there.

Leave a comment