-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Another "serverRenderer is not a function" question. #83
Comments
I started getting this error again after upgrade to webpack 4. Very annoying ( |
@phyllisstein it looks like you're actually creating a brand new instance of the webpack compiler for each request which comes in so even if you did get it working it'd be incredibly slow? I don't think the @smashercosmo I just added this to a new project using webpack 4 and all us fine -- chances are your webpack config is incorrectly setup -- I'd recommend checking that the server config is correctly outputting a |
@richardscarrott Yes, libraryTarget for node bundle is commonjs2. I solved the issue by using |
in the webpack config for the server your entry point should be string:
You should change output.filename if your are using [name] computed property. |
Hi there! I hate to pile on with this particular issue, but after reading through the other tickets dealing with it I'm still having some trouble with "serverRenderer is not a function" errors.
As far as I can tell from dropping in some naïve
console.log
statements, the middleware'sdoneHandler
is never being called. But I'm fairly certain that I'm passing the same compiler instance into both the dev middleware and the server middleware. Even adding extra padding withwebpack-dev-middleware
'swaitUntilValid
method doesn't seem to help.My server currently looks like this:
It's a little unorthodox because I'm creating the compiler in another middleware---a bug in the application server is currently making it impossible to call
webpack
in the outer scope---but I've confirmed that mutations to the object in one middleware persist in the subsequent ones. And I'm fairly certain that theawait middleware()
calls are working the way I expect, because requests to the server don't error out until the Webpack build is nominally finished and because switching tohtml-wepback-plugin
sans server integration works fine. Finally, the application server probably isn't at fault, since swapping out itscreateServer
for the standardhttp
function yields the same result.It's a shot in the dark, but if the maintainers can spot anything deeply wrong that I've neglected I'd be only too eager to hear it. Thanks in advance for your thoughts, and thanks for your work on this package.
The text was updated successfully, but these errors were encountered: