facebook / create-react-app

Set up a modern web app by running one command.
https://create-react-app.dev
MIT License
102.51k stars 26.77k forks source link

(node:23640) 'onAfterSetupMiddleware' 'onBeforeSetupMiddleware' #12165

Open alliresan opened 2 years ago

alliresan commented 2 years ago

After an update of the package react-scripts from version 3.0.1 to 5.0.0, I receive the next 2 warnings: (node:23640) [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:23640) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.

The previous version of package.json includes the next dependencies: "dependencies": { "@material-ui/core": "^4.9.7", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "^4.0.0-alpha.46", "@reach/router": "^1.3.4", "amazon-cognito-auth-js": "^1.3.3", "amazon-cognito-identity-js": "^5.2.7", "aws-sdk": "^2.1089.0", "axios": "^0.26.1", "bluebird": "^3.7.2", "bootstrap": "^5.1.3", "connected-react-router": "^6.9.2", "dotenv": "^16.0.0", "es6-promise": "^4.2.8", "express": "^4.17.3", "file-saver": "^2.0.5", "file-system": "^2.2.2", "file-type": "^17.1.1", "fs": "0.0.1-security", "isomorphic-fetch": "^3.0.0", "jszip": "^3.7.1", "jszip-utils": "^0.1.0", "jwt-decode": "^3.1.2", "multiparty": "^4.2.3", "query-string": "^7.1.1", "react": "^16.13.1", "react-bootstrap": "^2.2.0", "react-datepicker": "^4.7.0", "react-dom": "^16.13.1", "react-dropzone": "^12.0.4", "react-idle-timer": "^4.6.4", "react-loading-overlay": "^1.0.1", "react-redux": "^7.2.6", "react-router-dom": "^5.1.2", "react-scripts": "3.0.1", "react-toastify": "^8.2.0", "redux": "^4.1.2", "redux-thunk": "^2.4.1", "secure-ls": "^1.2.6", "universal-cookie": "^4.0.4" },

and only update the line: "react-scripts": "3.0.1", to "react-scripts": "5.0.0",

React version:

Steps To Reproduce "react-scripts": "3.0.1", "react-scripts": "5.0.0", Link to code example:

The current behavior Warnings

The expected behavior No Warnings

alliresan commented 2 years ago

I open this issue because of: https://github.com/facebook/react/issues/24073

Thanks in advance

daniel-arnauer commented 2 years ago

Duplicate of #11860 ?