I am updating to webpack@4.23, I ran in to this compilation error of TypeError: chunk.isInitial() is not a function
in one of my custom webpack plugins, may be we need to update some syntax but basically what I want to know is how to debug webpack plugins because i might run to some other compilation error most definitely :D
Here is snippet of plugin
const asyncLib = require('async');
// Plugin starts here
class CustomPluginName {
constructor(options) {
this.options = options;
}
apply(compiler) {
compiler.plugin('emit', (compilation, callback) => {
////// doing something
asyncLib.forEach(compilation.chunks, (chunk, chnkCallback) => {
if (!chunk.isInitial()) { // error occuring here
chnkCallback();
return;
}
// rest of code
});
});
}
}