Error: NormalModuleFactory.afterResolve is no longer a waterfall hook, but a bailing hook instead.

See original GitHub issue

Bug 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:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

35reactions
alexander-akaitcommented, Oct 12, 2020

You need to open issue in lodash-webpack-plugin and script-ext-html-webpack-plugin repos

Could these plugins cause the error I receive?

yes

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 on import { something } from 'lodash';

8reactions
alexander-akaitcommented, Oct 12, 2020

@creage Sorry without additional information we can’t help

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found