This seems pretty odd. I don’t know how to help besides asking very general questions.
Are you sure JavaScript is working? Are you talking about a live site, that worked before? Can you run JavaScript in the browser’s console? Does the problem appear with different browsers or only with a specific one?
Yes, I used other JavaScript files inside the website that are all working, and its a live website only. I tried other browsers, and I am getting the same error. I used the env file to give the file path. The styles are used on the React page and are all working in wordpress page as well. But Without an env file, my app is working with WordPress is fine. please suggest me without affecting the website how to connect env file react with WordPress.
I don’t know, this is probably a problem with your hosting provider. Maybe you can create a video or something.
Otherwise, I can only refer you to the documentation at: https://rockiger.com/en/reactpress/reactpress-tutorial/