Betelhem Elfagid
2 min readDec 17, 2021

--

“YOU NEED TO ENABLE JAVA SCRIPT”

You might have seen ‘error while fetching, you need to enable java script’ error in your browser console in different circumstances, well I had this error while I am trying to do my flatiron school final project.

It is such a simple error yet took me a while to figure out what the error implies.

I used React/Redux for the front end and Ruby for the back end.

After creating my own API, I was trying to fetch from it and wanted to be able to see my response data on my browser however whenever I run the server it couldn’t generate or load my data on the browser, I have tried to google and try so many ways to fix the error until I figured out that I just missed a simple step.

As I have my backend and front end separately, all I needed to do was run the front and the back end on a different sever otherwise I wouldn’t be able to start both front and backend on the same server as it is impossible for the frontend end to access the backend endpoints and I also needed to run both front and backend servers at the same time so that my front and back end can communicate to share resources but instead what I was doing was running my back and front end on the same server using localhost//3000 which means when I run the front end the back end will stop and vice versa which will not allow my front end to access the data from my back endpoint and I will not have a data to fetch from.

Therefore, if you got this kind of error don’t waste too much time, just create a different server for the back end and run both servers at the same time in order to allow our servers to cross share the data.

I run my backend on localhost/8080 but you can run it 3001 or on a different server that is different from your front-end server.

To create my backend server, I run ‘rvmsudo rails server -p 80’ and start the backend server using ‘rails s -p 80’.

I hope this might help someone.

Happy coding and stay safe!

--

--

Betelhem Elfagid
0 Followers

Full stack software engineering graduate from Flatiron School.