serverRenderer is not a function
See original GitHub issueenvironment :
node 8.9
webpack 4.12
webpack-hot-server-middleware 0.5.0
error
serverRenderer is not a function
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
type error: server render is no a function - Stack Overflow
serverRender() doesn't return Promise . You can try to the callback based approach. const serverRender = (callback) ...
Read more >Server-Side Rendering API - Vue.js
This method is not supported in the ESM build of vue/server-renderer , which is decoupled from Node.js environments. Use pipeToNodeWritable instead.
Read more >vue-server-renderer | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >Server-side Rendering - Yew
Yew provides a ServerRenderer to render pages on the server-side. ... rendering support, prefer function components unless you have a good reason not...
Read more >TypeError: "x" is not a function - JavaScript - MDN Web Docs
The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value...
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 FreeTop 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
Top GitHub Comments
Both react-universal-component and webpack-hot-server-middleware can work with Webpack 4. However, this issue can get in the way: https://github.com/webpack/webpack/issues/7516
The “serverRenderer is not a function” error happens most often because the real error is swallowed on one of these two lines: https://github.com/60frames/webpack-hot-server-middleware/blob/master/src/index.js#L152-L153
In the case of async code splitting - any code splitting, not just react-universal-component - that Webpack issue can leave you with a chunk name based off an async chunk rather than your entry point. So, with an entry name of “server” and an
import()
of “Home” will sometimes cause LimitChunkCountPlugin to use the output + chunk name “Home” instead of “server,” which leaves webapck-hot-server-middleware unable to find the default/configured chunk name + file of “server.”I’m attempting to put together a PR to provide friendly error reporting when something fails on these two lines. Took me the better part of an hour to figure out what was going on here.
in the webpack config for the server your entry point should be string:
entry: "./src/server/render.js",
You should change output.filename if your are using [name] computed property.