Error: [universal-webpack] Your server source file must export a function
See original GitHub issueI 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?
Issue Analytics
- State:
- Created 7 years ago
- Comments:16 (9 by maintainers)
Top Results From Across the Web
Error: [universal-webpack] Your server source file must export ...
it throw this error this is my webpack config: `import path from 'path'; import webpack from 'webpack'; import WebpackNotifierPlugin from ...
Read more >universal-webpack - npm
Start using universal-webpack in your project by running `npm i ... source/server.js", ... The server code must export a function.
Read more >Next.js 5: Universal Webpack, CSS Imports, Plugins and Zones
Errors that happen when server rendering now point to the correct function and line number. Errors now show the correct line, file and...
Read more >What is the syntax to export a function from a module in Node.js?
In Node you export things with module.exports special object. For example: This exports both functions: module.exports = { foo, bar };.
Read more >Importing and Exporting—Wolfram Language Documentation
m, and the converter sources reside in the files Converter.m. Format Registration. An Export format must first be registered. Note that, unlike registering...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
Oops, really.