-
Notifications
You must be signed in to change notification settings - Fork 26
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
Please upgrade to Webpack 5 #40
Comments
In Webpack5, Use the following code to replace lines 119 and 120 of the project source file and recompile,
|
I published a new package with the name "start-server-nestjs-webpack-plugin" where this problem has been fixed. in case someone has the same need. |
please, I install your package: npm i -D start-server-nestjs-webpack-plugin const StartServerPlugin = require("start-server-nestjs-webpack-plugin"); |
sends me his entire "webpack-hmr.config.js" so i can understand |
const webpack = require('webpack');
const nodeExternals = require('webpack-node-externals');
const StartServerPlugin = require("start-server-nestjs-webpack-plugin");
//const StartServerPlugin = require('start-server-webpack-plugin');
module.exports = function(options) {
return {
...options,
entry: ['webpack/hot/poll?100', options.entry],
watch: true,
externals: [
nodeExternals({
allowlist: ['webpack/hot/poll?100'],
}),
],
plugins: [
...options.plugins,
new webpack.HotModuleReplacementPlugin(),
new webpack.WatchIgnorePlugin([/\.js$/, /\.d\.ts$/]),
new StartServerPlugin({ name: options.output.filename }),
],
};
}; |
@douglasgc I have created strongly typed (typescript) repo with the fix provided, also cleaned the code so it is a bit more readable. Also it is quite disguising having a nestjs in name, so I changed a name to shorter and closer to behavior one- |
Hi, I have followed all the change but still not working for me it's saying that: Error The 'compilation' argument must be an instance of Compilation (node:2593) [DEP_WEBPACK_WATCH_WITHOUT_CALLBACK] DeprecationWarning: A 'callback' argument need to be provided to the 'webpack(options, callback)' function when the 'watch' option is set. There is no way to handle the 'watch' option without a callback. Did I fail something or someone else have the same problem? |
@Pilo3369 there are no changes for more than a year. I advise you to use my fork of current repo (link above) |
Hi thanks for the answer but I'm using your fork and I have this trouble with your fork :) |
@atassis I got the same issue as @Pilo3369 with your fork. The error seems to have been introduced with Webpack v5.10.0, it doesn't occur with v5.9.0. Unfortunately, even if it compiles successfully with v5.9.0, I got the following error on file change:
|
@Flo-D can't get an error in this version webpack or even higher, so I definitely need an issue in my repo |
@atassis Unfortunately you've been using the cluster (master) branch of this repository. If installed with beta tag, |
Here is the issue: #12 |
@bkniffler I'll look that through, but still wanna admit, that you can create an issue if something was done wrong in my repo |
@atassis I've created a PR! |
Ok, thats kinda need some cleaning, but still nice |
Thanks, @atassis looks like it's work at least I don't have the same issue but don't know from where it's come so I write it here for now: Error: [HMR] Hot Module Replacement is disabled. |
the current version is not compatible with Webpack 5
The text was updated successfully, but these errors were encountered: