universal-webpack: Error: [universal-webpack] Your server source file must export a function
I try to start the server build server like following:
nodemon -L ./start-server.js --exec babel-node --watch ./build/server
The server.js (built with webpack located in ./build/server/server.js) have a special webpack exported format and start-server.js and universal-webpack/server.js run in a normal node environment and tries to include the buit server.js here
https://github.com/halt-hammerzeit/universal-webpack/blob/master/source/server.js#L41
The result is that the “starter” variable become following:
[ 0, 1 ]
What did I miss?
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 16 (9 by maintainers)
Commits related to this issue
- Fixes #11. Fixes #10. Added `exclude_from_externals` setting + CommonsChunkPlugin fix — committed to catamphetamine/universal-webpack by deleted user 8 years ago
The comparison is not correct, it don’t remove any plugins now. It must check if the constructor.
should be:
Maybe a instanceof check do the job as well.