React start scripts issue in Windows

Hey guys, so currently the package.json file in frontend directory contains "start": "GENERATE_SOURCEMAP=false HTTPS=true react-scripts start", as start script for react.

This works well for Linux, Mac but Windows doesn’t support this syntax and thus leads to the error below.

'GENERATE_SOURCEMAP' is not recognized as an internal or external command,
operable program or batch file.

I recommend moving to the more conventional way of setting these environment variables by using a .env file in the root directory which would then look like this:

.env:

GENERATE_SOURCEMAP=false
HTTPS=true

and the react script in package.json would then change to "start": "react-scripts start"

I tried this approach, and it worked! should I open a pr for this or open an issue first?

let me know what you guys think.

Since we run the application through docker, this shouldn’t be a problem.
Can you share the full logs from where you encountered this error?

okay so I understand now that you guys are using docker so I’ll be doing the same.
As per the readme file, I’ve cloned the code and ran the command

docker-compose -f build.docker-compose.yml up -d --build

but this leads to the error:

 => ERROR [oe.openelis.org build  5/10] RUN ./install/createDefaultPassword.sh -c -p adminADMIN  2.0s 
 => CACHED [oe.openelis.org stage-1  2/15] COPY install/createDefaultPassword.sh ./              0.0s 
 => CACHED [oe.openelis.org stage-1  3/15] RUN rm -rf /usr/local/tomcat/webapps/*     /usr/loca  0.0s 
 => CACHED [oe.openelis.org stage-1  4/15] COPY install/tomcat-resources/ROOT.war /usr/local/to  0.0s 
------
 > [oe.openelis.org build  5/10] RUN ./install/createDefaultPassword.sh -c -p adminADMIN!:
0.914 /bin/sh: 1: ./install/createDefaultPassword.sh: not found
------
failed to solve: process "/bin/sh -c ./install/createDefaultPassword.sh -c -p ${DEFAULT_PW}" did not complete successfully: exit code: 127

I believe its due to this line in the Dockerfile

...
# OE Default Password
ARG DEFAULT_PW="adminADMIN!"
COPY ./install/createDefaultPassword.sh /build/install/createDefaultPassword.sh
WORKDIR /build
RUN ./install/createDefaultPassword.sh -c -p ${DEFAULT_PW}

Any idea on how to resolve this?

@adityaa you don’t have to build or code-base using build.docker-compose.yml file

you have have to run the code base using dev.docker-compose.yml file

[ also can you change yourname & username with your fullname, since there will be conflict of tags can happen thank you]

[ also can you change yourname & username with your fullname, since there will be conflict of tags can happen thank you]

No issues, I’ll do that.

also, trying to run the containers using docker-compose -f dev.docker-compose.yml up -d but the oe-certs container doesn’t seem to start:


is this a problem?

and the username: admin & password: adminADMIN! seem to not work too?


how to resolve this?

Hi @adityaa this is shouldn’t be a big issue in the dev env unless in production.

1 Like

those are the right credentials, Do you mind dropping the volumes(using dev.docker-compose.yml down -v) and run docker-compose -f dev.docker-compose.yml up -d again.

I am not sure that’s a valid command, instead I’ve run docker-compose down -v and docker-compose -f dev.docker-compose.yml up -d like you said.

the containers r up and running, but the login issue from before still persists:

Am I doing something wrong here?

Do you mind sharing the logs of the webapp container.

Hello thank you for responding. After much research myself, I came to believe the dev.docker-compose.yml file was somehow holding me back on the credential issue.

This post confirmed my suspicions.

Thus I resolved it by running docker compose up. I believe the issue persists in dev.docker-compose.yml as this post too states the same.

@adityaa

TBH this docker compose up command runs docker-compose files which doesn’t append the changes [ local changes to docker container ] this will lead to problems.

Yes I’ve come to realize that now. This now leads me to this ans which for some reason doesn’t work for me.

when I run

 cd OpenELIS-Global-2
 git submodule update --init --recursive
 cd dataexport
 mvn clean install -DskipTests

It gives me the following error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project dataexport-core: Fatal error compiling: java.lang.ExceptionInInitializerError: 
Unable to make field private com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors com.sun.tools.javac.processing.JavacProcessingEnvironment.discoveredProcs accessible: 
module jdk.compiler does not "opens com.sun.tools.javac.processing" to unnamed module @6aa5974e -> [Help 1]
[ERROR]

I suppose its due to the jdk version (jdk 21) I am having? If so, which one should I use?
And even after changing the version and successfully executing the above commands will the “Invalid credentials” issue still persist?

I’ll hop on the dev call this thursday to discuss this if needed.

java and jdk version 11 should be use to build the docker image

Okay so I installed java 11 and its working fine. I ran everything from this successfully, but still it shows wrong username and password.

Any ideas?

webapp container logs:

2025-01-06 10:58:25 2025-01-06T08:28:25.188+0300 -- INFO -- Completed initialization in 4 ms
2025-01-06 10:58:25 2025-01-06T08:28:25.253+0300 -- INFO -- hapi.home is set to /usr/local/tomcat/.
2025-01-06 10:58:25 2025-01-06T08:28:25.290+0300 -- INFO -- HAPI version is: 2.3
2025-01-06 10:58:25 2025-01-06T08:28:25.300+0300 -- INFO -- Default Structure libraries found for HL7 versions 2.5.1, 
2025-01-06 10:58:25 2025-01-06T08:28:25.874+0300 -- INFO -- org.apache.catalina.startup.HostConfig deployWAR Deployment of web application archive [/usr/local/tomcat/webapps/OpenELIS-Global.war] has finished in [63,444] ms
2025-01-06 10:58:26 2025-01-06T08:28:26.007+0300 -- INFO -- org.apache.coyote.AbstractProtocol start Starting ProtocolHandler ["https-jsse-nio-8443"]
2025-01-06 10:58:26 2025-01-06T08:28:26.137+0300 -- INFO -- org.apache.catalina.startup.Catalina start Server startup in 172427 ms
2025-01-06 11:00:28 2025-01-06T08:30:28.963+0300 -- INFO -- Class: AuthenticationListener, Method: onFailure, Info: Unsuccessful login attempt for admin
2025-01-06 11:00:28 2025-01-06T08:30:28.988+0300 -- INFO -- Class: CustomAuthenticationFailureHandler, Method: onFailure, Info: Unsuccessful login attempt from 172.20.1.1

Let me know what might work here

@adityaa try using gitpod / github codespaces to setup the codebase!

Is there no other way? I don’t want to rely on codespace for everyday coding

@adityaa either you can use a WSL machine to run the application in your Windows machine

or you can use GITPOD as a development environment connected to your local VSCODE

or DUAL BOOT your PC windows + any LINUX OS! { Risky }