From the code you posted, it looks like you are trying to run express in the browser. I say this because the express import is in a file which also has document.getElementById. This is not supported, and I am guessing this code was not generated by create-react-app. Not sure what you are going for with the posted code, so I cannot help more than that, sorry.
Yeah it was because of that, I've split the server into a seperate file. Now I just need to figure out how to make them work with each other, but I'll hopefully figure this out on my own. Thanks for the tip!
No problem. Good luck!
I'm having the same issue with my server, but I don't understand how to solve it. When you say you split the server into a separate file, what exactly does that mean? It's my first time trying to set up a server, and I was under the impression that the "server" was actually a bunch of different files working together.
Hey @Jazy1618, I think you should post some code examples on Stack Overflow. The OP was not an express bug, and my guess is that your issue is also not. There is also a Gitter for the express community were you can find help. https://gitter.im/expressjs/express
I was under the impression that the "server" was actually a bunch of different files working together.
This is true, and my assumption based on lack of information from the OP is that it was the code which creates the express instance which was moved to a separate file.
Oh, thank you! I'll post it on the express Gitter with some code.
@EleosOS - did you find solution for same error i got with react webpack.
TypeError: Cannot read property 'prototype' of undefined
how did you solve it?
Most helpful comment
how did you solve it?