Hi Team,
Need your assistance on this.
We have three custom apps in our instance which is working fine. But in local we are getting CORS error. The localhost port 3000 has been added properly in DHIS. We are able to build the apps but not able to run it in local.
Hi @Sweety_Sharma : Thanks for the update and sorry that it is still not working. I’m a little confused when you say the proxy did not work. Are you still getting the CORS error after proxing the server? Or is the proxy server not starting?
The procedure to use the proxy server would be:
run your app with yarn start --proxy https://YOUR_INSTANCE_HERE --proxyPort 8082 (you can use some other proxy port)
check that the proxy is running (in this example at port 8082). You should try to login in there. You should be able to log in to the instance (if you get a 404 error about the resource not being found after log in, you can ignore this)
If you are still getting a CORS error at this point, can you check that the whitelisted server is being persisted on the backend (api/configuration/corsWhitelist)? The result should be an array. (I see from your screenshot that you had the whitelisted app is it in your settings app, but it could be that it is typed in the field but not properly persisted in the database).