You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm creating a web application with many pages as components and it uses ExpressJS framework on the NodeJS backend. I want to implement SSR to improve performance (since it's a relatively small project) and be ready for the best SEO practices.
However, even though my server setup looks just fine (no errors on console from nodemon or React), when I visit the server on the browser, I see a blank screen, where the #root is not filled with the App component.
I'm not sure if whatever I'm doing is wrong, because the examples I could find online did not match exactly with what I'm dealing with.
The React render on localhost:3000 works perfectly. But, the SSR on localhost:3001 shows me a blank screen, with the empty index.html loaded (#root div is empty).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm creating a web application with many pages as components and it uses
ExpressJS
framework on theNodeJS
backend. I want to implement SSR to improve performance (since it's a relatively small project) and be ready for the best SEO practices.However, even though my server setup looks just fine (no errors on console from
nodemon
orReact
), when I visit the server on the browser, I see a blank screen, where the#root
is not filled with theApp
component.I'm not sure if whatever I'm doing is wrong, because the examples I could find online did not match exactly with what I'm dealing with.
The React render on
localhost:3000
works perfectly. But, the SSR onlocalhost:3001
shows me a blank screen, with the empty index.html loaded (#root div is empty).Here is the
server.js
for ExpressJS:https://pastebin.com/uFZApGHc
The
App
component:https://pastebin.com/p93UPFz5
Express package.json:
https://pastebin.com/pz9KijwR
React package.json:
https://pastebin.com/1xP4PzJP
Project structure:

If there is any other information needed, please tell me and I'll include them. Any ideas or contributions are appreciated.
Beta Was this translation helpful? Give feedback.
All reactions