If you host on IIS, one of the possible reasons is that you get this because IIS blocks the verb OPTIONS . Because of this, I spent almost an hour:
One tell-tale - you get a 404 error during an OPTIONS request.
To fix this, you need to explicitly tell IIS not to block the OPTIONS request.
Go to query filtering:

Make sure the options are enabled:

Or just create web.config with the following setting:
<system.webServer> <security> <requestFiltering> <verbs> <remove verb="OPTIONS" /> <add verb="OPTIONS" allowed="true" /> </verbs> </requestFiltering> </security> </system.webServer>
Rosdi Kasim Nov 13 '18 at 11:47 2018-11-13 11:47
source share