Trouble accessing DHIS2 instance with a local WSL created DHIS2 web application

Hello everyone.
I localy created a DHIS web application in a WSL.
But I’m having trouble to access it via browser using the addresses and the login details shared in this guide Creating a DHIS2 Web app | DHIS2 Developer Portal.
Please find attached a shot of the window I got while trying to connect to DHIS2 via the web App.


When I hit “Sign in”, the page just reloads; the DHIS2’s welcome page doesn’t show-up.
Thanks in advance for any help in fixing this.
Regards,
DAGBEMAMBOU

1 Like

Hi @DAGBEMAMBOU

Please refer to the below trail. Hope this helps.

1 Like

Hi @DAGBEMAMBOU

Did the topic @Vishwanideep_Kumar refer to help? If not I’d be happy if you could share more details such as the Network log from the DevTools (F12) when you click on Sign In.

Also, are you sure that the instance ‘localhost’ is using port 8080? Please check the configuration.

I’m also happy to see that you have now managed to have a locally running instance, well done!

Hi @Gassim
Thank you for your reply.
Unfortunately, the topic @Vishwanideep_Kumar referred to didn’t help me.
Please, find attached the Network log from the DevTools


After checking, I found that nothing is using port 8080.
Thank you for any help to fix that issue.
Regards

1 Like

@Vishwanideep_Kumar
Thank you so much for your reply.
Unfortunalely, it didn’t work for me and I’m still facing the issue.
So, any other tips to help solve this would be greatly appreciated.
Once again, thanks for your help.
Regards.

1 Like

Hi!

Do you have a dhis2 instance running locally at 8080 or with some other port?
You can find instructions to do so here: How to spin up a DHIS2 local instance | DHIS2 Developer Portal. Getting it to work might be a little harder with WSL though from experience.


An alternative is to use an online instance you might have access to, Login app | DHIS2 for instance. You start your app with:

yarn start --proxy https://play.im.dhis2.org/stable-2-42-1

You should be able to note in the console the following new lines:

Starting proxy server... 
The proxy for https://play.im.dhis2.org/stable-2-42-1 is now available on port 8080

Now you should be able to connect via the proxy:


You want to make sure the instance you connect to (local or online) has the correct CORS allow list as indicated in the topic shared by Vishwanideep Kumar (How can I connect to a live DHIS2 instance from a localhost custom app).


I hope that’s helpful,
Bruno

1 Like