Error: NormalModuleFactory.afterResolve is no longer a waterfall hook, but a bailing hook instead.
See original GitHub issueBug report
What is the current behavior?
Webpack build crashes with error
Error: NormalModuleFactory.afterResolve is no longer a waterfall hook, but a bailing hook instead. Do not return the passed object, but modify it instead. Returning false will ignore the request and results in no module created.
If the current behavior is a bug, please provide the steps to reproduce.
Follow NormalModuleReplacementPlugin usage guide
module.exports = function(env) {
var appTarget = env.APP_TARGET || 'VERSION_A';
return {
plugins: [
new webpack.NormalModuleReplacementPlugin(/(.*)-APP_TARGET(\.*)/, function(resource) {
resource.request = resource.request.replace(/-APP_TARGET/, `-${appTarget}`);
})
]
};
};
What is the expected behavior? It should build as before
Other relevant information: webpack version: 5.0.0 Node.js version: v14.9.0 Operating System: Windows 10 Additional tools: -
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:5 (3 by maintainers)
Top Results From Across the Web
webpack - --mode development Error: NormalModuleFactory ...
Error: NormalModuleFactory.beforeResolve is no longer a waterfall hook, but a bailing hook instead. Do not return the passed object, ...
Read more >NormalModuleFactory.afterResolve is no longer a waterfall hook
When I tried Webpack 5 RC 0, I received the following error. It looks like this module may be the cause. webpack@5.0.0-rc-0 tapable@2.0.0 ......
Read more >NormalModuleFactory Hooks - webpack
The NormalModuleFactory class extends Tapable and provides the following lifecycle hooks. They can be tapped the same way as compiler hooks:
Read more >Webpack issues NormalModuleFactory - Moralis Web3 Forum
... Error: NormalModuleFactory.resolve (NormalModuleFactory) is no longer a waterfall hook, but a bailing hook instead. Do not return the ...
Read more >FAST_REFRESH=true causes compilation error (Webpack 5 ...
/Users/richard/uc/web/node_modules/webpack/lib/NormalModuleFactory.js:294 throw ... problem too ("no longer a waterfall hook, but a bailing hook instead") ...
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
You need to open issue in
lodash-webpack-pluginandscript-ext-html-webpack-pluginreposyes
https://github.com/lodash/lodash-webpack-plugin/blob/master/src/index.js#L41
Sorry, we can’t fix it on our side, my recommendation is avoid using
lodash-webpack-plugin, just rewrite your code onimport { something } from 'lodash';@creage Sorry without additional information we can’t help