Skip to content

Deprecation Warning for Compilation.hooks.normalModuleLoader #123

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

Open
protoEvangelion opened this issue Jun 17, 2020 · 19 comments
Open

Deprecation Warning for Compilation.hooks.normalModuleLoader #123

protoEvangelion opened this issue Jun 17, 2020 · 19 comments

Comments

@protoEvangelion
Copy link

protoEvangelion commented Jun 17, 2020

Getting webpack deprecation warning on v1.3.3 & webpack v5.0.0-beta.17:

[DEP_WEBPACK_COMPILATION_NORMAL_MODULE_LOADER_HOOK] DeprecationWarning: Compilation.hooks.normalModuleLoader was moved to NormalModule.getCompilationHooks(compilation).loader

It's occuring right here: node_modules/speed-measure-webpack-plugin/WrappedPlugin/index.js:148:19

Maybe because every available webpack hook is being wrapped here: node_modules/speed-measure-webpack-plugin/WrappedPlugin/index.js:147:38?

  const wrapped = Object.keys(hooks).reduce((acc, method) => {
    acc[method] = genProxy(method);
    return acc;
  }, {});
@tjx666
Copy link

tjx666 commented Oct 13, 2020

+1

@ermuz
Copy link

ermuz commented Feb 8, 2021

Since webpack v5 normalModuleLoader hook was removedhttps://webpack.js.org/api/compilation-hooks/#normalmoduleloader.
The smp registered the hook at therehttps://github.com/stephencookdev/speed-measure-webpack-plugin/blob/b5ff09e699416fe336d1df1896af5c50e6596deb/index.js#L159.It's seem like the author hadn't adapted to the Webpack v5 very well,although the official support of webpack v5 has been announced in the v1.4.2 version.

@thw0rted
Copy link

This could probably be closed in favor of #149 which includes other v5-specific concerns. Official support for Webpack 5 still isn't quite here yet.

@pumano
Copy link

pumano commented Sep 20, 2021

any news on this?

@zjtt
Copy link

zjtt commented Jan 17, 2022

DeprecationWarning: Compilation.hooks.normalModuleLoader was moved to NormalModule.getCompilationHooks(compilation).loader

@yxlolxy
Copy link

yxlolxy commented Feb 26, 2022

same question at 2022.2.26

@AdamElhawary
Copy link

Same Here!

@zjtt
Copy link

zjtt commented Apr 2, 2022 via email

@justinfarrelldev
Copy link

Still an issue with me, Webpack ^5.73.0 and using speed-measure-webpack-plugin ^1.5.0

@RemLawrence
Copy link

Any updates on this?

@2812848295
Copy link

2022-10-27 还在出现这个问题,"speed-measure-webpack-plugin": "^1.5.0", webpack ^5

@zjtt
Copy link

zjtt commented Oct 27, 2022 via email

@ltc117
Copy link

ltc117 commented Jan 3, 2023

Still an issue with me, Webpack 5.75.0 and using speed-measure-webpack-plugin 1.5.0

@sandrinjoy
Copy link

(node:43571) [DEP_WEBPACK_COMPILATION_NORMAL_MODULE_LOADER_HOOK] DeprecationWarning: Compilation.hooks.normalModuleLoader was moved to NormalModule.getCompilationHooks(compilation).loader
(Use node --trace-deprecation ... to show where the warning was created)

Same issue. getting stuck here when trying to build
"react-scripts": "^5.0.1",
"react": "^17.0.2",
"react-app-rewired": "^2.1.8",

@qidasheng369
Copy link

qidasheng369 commented Jul 26, 2023

(node:43571) [DEP_WEBPACK_COMPILATION_NORMAL_MODULE_LOADER_HOOK] DeprecationWarning: Compilation.hooks.normalModuleLoader was moved to NormalModule.getCompilationHooks(compilation).loader (Use node --trace-deprecation ... to show where the warning was created)

Same issue. getting stuck here when trying to build "react-scripts": "^5.0.1", "react": "^17.0.2", "react-app-rewired": "^2.1.8",

same to me.

(node:1012) [DEP_WEBPACK_COMPILATION_NORMAL_MODULE_LOADER_HOOK] DeprecationWarning: Compilation.hooks.normalModuleLoader was moved to NormalModule.getCompilationHooks(compilation).loader
(Use node --trace-deprecation ... to show where the warning was created)

@amandogra
Copy link

Has this been resolved?

@yangs2016
Copy link

I recently upgraded React 16 to 18, and now I am getting this warning every time I tried to run npm run build DeprecationWarning: Compilation.hooks.normalModuleLoader was moved to NormalModule.getCompilationHooks(compilation).loader

Has anyone found a fix for this warning?

@AZEEMAZAM1
Copy link

Step 1: Identify where the issue is

Look into your custom CSS files (especially the ones in src/index.css, or any imported component CSS). Look for something like this:

background: url("/path/to/image");

or

content: "/";

If it's something like this, it's often not properly escaped for the build.
Step 2: Escape the slash

Try modifying lines like:

content: "/";

to

content: "/";

Or better yet, if it's a url(), ensure it uses a valid path and isn't causing the issue:

background-image: url("./assets/bg.jpg"); /* or wherever your image is */

for me it works as per gpt said

@zjtt
Copy link

zjtt commented Apr 11, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests