Skip to content
Advertisement

React/NodeJS – Web page doesn’t work when go at localhost:3000

first of all i’d like to say that i’m a new developer of React and NodeJS.

I want use this technologies: – React as a client – NodeJS as a server – Webpack for build my files.

My project structure is the follow:

my-application/

webpack.server.js

webpack.client.js

server.js

client/client.js

client/app.js

client/components/header.js

client/components/mainLayout.js

client/components/footer.js

The header and footer files are not important so i’m not writing here. The important file are the following:

mainLayout.js

JavaScript

app.js

JavaScript

client.js

JavaScript

server.js

JavaScript

Run my project:

JavaScript

but when i’m going at http://localhost:3000 my page response is {“key”:null,”ref”:null,”props”:{},”_owner”:null,”_store”:{}}.

I don’t understand why i have the error, something probably escapes me but i don’t what.

Can you help me please?

Thanks you in advance, AS

Advertisement

Answer

You are running both front and back end on the same port. Go to package.json for your react app and replace your start script with the following script:

JavaScript

This will be the first step for resolving your issue. If you keep getting errors after that, let us know what are they.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement