@mksd @mogoodrich @jomadoye. I cloned the repo on my machine. How do I run the sample page app from samples? Is anywhere a wiki page about this repo ? Thank you.
Cc @ayesh , you might also be able to unlock @andu033?
He’s integrating his first components on his fork and would like to know how to set himself up to test them at runtime? Is this documented anywhere?
You can find a demo repo which was setup by @beingtmk here to showcase the usage of react components.There he has the guidance to setup it.Hope this would help
Cc :- @judeniroshan
I get this error: “Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it’s defined in, or you might have mixed up default and named imports.”
@ayesh, @andu033 The above repository is based on new components that i am adding to the repository!
@andu033, You are getting the above error because the above repo is based on my fork of open-mrs-react components, and the main repo doesnt contain the components used in the above repository
can u let us know how to run the samples in the react-component repository.If so it would be great.
@andu033 & @ayesh, I checked out the samples, actually the sample is using the Login Page component & the login page component requires a backend to work as it queries the openmrs rest endpoint for verification.
Check this repo out, this repo is currently using the openmrs-react-components repository
You will also need to setup a server backend, i am using the mirebalais module & malawi module as backend for testing
Detailed instructions to setup are given in their individual Readme
Hey @beingtmk, how are you?
What are looking to do? Test the APZU app?
Let me talk with the team on Monday about getting you access… I suspect the Malawi team will push back on giving access to the entire database to people outside PIH/APZU (even de-identified), but there’s a de-identified staging server that I might be able to get you access to, but I’d need to get approval.
Take care, Mark
I did the setup of the backend server but i still get the same error. Maybe i did it incorectly?
Did you add a env.local file specifying the endpoint and port, Also be aware of CORS issue, it would awesome if you could provide the exact error
How do i do that?
Install this plugin
Another way to get around the CORS issue is to run Chrome without the CORS restriction:
Or, I just installed Chromium, and then ran it without security:
$ /Applications/Chromium.app/Contents/MacOS/Chromium --disable-web-security --user-data-dir=""
It worked. Thanks. Now i can test my components. But i have one more problem. If i change something in react-components and then run build:watch it will undo the changes. Any idea why?
Hi @andu033, This doesn’t happen with me!
Can you pls elaborate, i can’t figure it out just based on the above information?