The scenario is, I want to use the rasa nlu server with my react application. My react application runs on port 3000 and I am running rasa nlu server on port 5002.
While testing with postman application, nlu apis are working fine. But while doing the same api requests from the react application, it is failing.
The error I am facing while sending request:
xhr.js?14ed:178 OPTIONS http://localhost:5002/parse 403 (Forbidden)
Access to XMLHttpRequest at ‘http://localhost:5002/parse’ from origin ‘http://localhost:3000’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
I tried a lot to fix this issue with --cors argument, but still, it is not working and still showing the same errors again and again. Probably I am not understanding how to use the cors argument properly.
Can anyone tell me how to fix it? It will be a great help since there are no proper answers out there on how to use cors arguments on any website. Let me know if anyone needs more information on this.
I figured out the issue. It is because of the server.js of rasa nlu. Unfortunately, cross-origin and header support are not there.
After editing the server.js file, I am now able to execute cross origin requests.
For more information, please check this github issue:
im using
rasa run -m models --enable-api --cors “*”
but still getting this error
Access to XMLHttpRequest at ‘http://localhost:5005/socket.io/?EIO=3&transport=polling&t=Mt1DGKX’ from origin ‘null’ has been blocked by CORS policy: The ‘Access-Control-Allow-Origin’ header contains multiple values ‘null, null’, but only one is allowed.
Actually I’m trying to integrate the website using webchat only and in the integration there seems a problem. Can you help to fix this error so my bot can be used from a website.