React/node GET request: responds with html instead of js object

I have a static site deployed, without any errors. It’s a node+express app with the react build directory included and app.use(express.static('build')) to serve the front end.

When running the app locally, everything works as it should.

However, the deployed instance (no deployment errors) does not work. It seems like it’s not communicating with the server, possibly, but I can’t be sure. I don’t know how to troubleshoot this.

The local version responds to a GET request to localhost:8000/login with a message ‘You got the login page.’ as I have configured the express router to do this.

The deployed version responds instead, with the generic CRA public/index.html with ‘you need to enable javascript’ message. It’s not rendering this; the login page is displayed correctly, but it’s not responding at all when the form is submitted.

Why is this happening? Why won’t it communicate properly frontend → backend?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.