admin管理员组

文章数量:1123146

Im encountering the following warnings while running my webpack dev Server:

(node:5456) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:5456) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.

Ive tried to resolve this issue by updating my webpack configuration to replace the deprecated options with the recommended setupMiddlewares option, but unfortunately, it doesn't seem to work.

I tried updating my webpack Dev Server config by swapping out the old onBeforeSetupMiddleware and onAfterSetupMiddleware options for the new setupMiddlewares option I was hoping this would get rid of those annoying deprecation warnings when I run the server But even after making the change the warnings are still popping up which makes me think I might've missed something or that the new setup isn't working right

本文标签: javascriptHow to Fix Webpack Dev Server Deprecation Warnings for Middleware OptionsStack Overflow