Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

193
Views
Element type is invalid: expected a string (for built-in components) or a class/function. SSR with nodejs, react, react-router-dom

Sandbox: https://codesandbox.io/s/focused-dream-ko68k?file=/server/server.js

Error
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports. at ReactDOMServerRenderer.render (C:\Users\Gp\Desktop\testingg\server\node_modules\react-dom\cjs\react-dom-server.node.development.js:4053:17) at ReactDOMServerRenderer.read (C:\Users\Gp\Desktop\testingg\server\node_modules\react-dom\cjs\react-dom-server.node.development.js:3690:29) at Object.renderToString (C:\Users\Gp\Desktop\testingg\server\node_modules\react-dom\cjs\react-dom-server.node.development.js:4298:27) at C:\Users\Gp\Desktop\testingg\server/server.js:16:30 at Layer.handle [as handle_request] (C:\Users\Gp\Desktop\testingg\server\node_modules\express\lib\router\layer.js:95:5) at trim_prefix (C:\Users\Gp\Desktop\testingg\server\node_modules\express\lib\router\index.js:323:13) at C:\Users\Gp\Desktop\testingg\server\node_modules\express\lib\router\index.js:284:7 at Function.process_params (C:\Users\Gp\Desktop\testingg\server\node_modules\express\lib\router\index.js:341:12) at next (C:\Users\Gp\Desktop\testingg\server\node_modules\express\lib\router\index.js:275:10) at expressInit (C:\Users\Gp\Desktop\testingg\server\node_modules\express\lib\middleware\init.js:40:5)

Code React/index.js react/src/index.js

React/App.js react/src/App.js

Server/index.js -- node_module to node_modules. but it still doesn't work. server/index.js

Server/server.js Server/server.js

File Structure file structure

Please help I'm stuck for 2 days now and have no idea on what's wrong. I'm trying to server side render my react application but it doesn't wanna work.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

May be unrelated, but I've noticed a node_module instead of node_modules in server/index.js .

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!