I’m applying npm run build
and I’m getting:
Creating an optimized production build...
Failed to compile.
HookWebpackError: Cannot read properties of undefined (reading 'e')
-- inner error --
TypeError: Cannot read properties of undefined (reading 'e')
Generated code for C:UsersGersoOneDriveDocumentosReact JShomenode_modulescss-loaderdistcjs.js??ruleSet[1].rules[1].oneOf[5].use[1]!C:UsersGersoOneDriveDocumentosReact JShomenode_modulespostcss-loaderdistcjs.js??ruleSet[1].rules[1].oneOf[5].use[2]!C:UsersGersoOneDriveDocumentosReact JShomenode_modulessource-map-loaderdistcjs.js!C:UsersGersoOneDriveDocumentosReact JShomesrcindex.css
1 | __webpack_require__.r(__webpack_exports__);
2 | /* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("C:\Users\Gerso\OneDrive\Documentos\React JS\home\node_modules\babel-loader\lib\index.js??ruleSet[1].rules[1].oneOf[4]!C:\Users\Gerso\OneDrive\Documentos\React JS\home\node_modules\source-map-loader\dist\cjs.js!C:\Users\Gerso\OneDrive\Documentos\React JS\home\node_modules\css-loader\dist\runtime\sourceMaps.js");
3 | /* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
4 | /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("C:\Users\Gerso\OneDrive\Documentos\React JS\home\node_modules\babel-loader\lib\index.js??ruleSet[1].rules[1].oneOf[4]!C:\Users\Gerso\OneDrive\Documentos\React JS\home\node_modules\source-map-loader\dist\cjs.js!C:\Users\Gerso\OneDrive\Documentos\React JS\home\node_modules\css-loader\dist\runtime\api.js");
5 | /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
6 | // Imports
7 |
8 |
9 | var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
10 | // Module
11 | ___CSS_LOADER_EXPORT___.push([module.id, ".font-msg {rn font-family: 'Hanalei Fill', cursive;rn border: 100px;rn}rnrn.skillHover:hover{rn background-color: #ebebeb !important;rn border-left: 10px solid midnightblue !important;rn border-radius: 0% !important;rn box-shadow: rgba(17, 17, 26, 0.1) 0px 4px 16px, rgba(17, 17, 26, 0.1) 0px 8px 24px, rgba(17, 17, 26, 0.1) 0px 16px 56px;rn}rnrn.textSkill{rn color: rgb(124, 124, 124);rn font-size: 1rem;rn}rnrn.contact{rn margin: auto !important;rn background-color: #ebebeb !important;rn background:'#f1f1f1' !important;rn border-radius:'10px' !important;rn}rnrn.text404{rn color: midnightblue !important;;rn}rnrn@media (max-width: 700px){rn .image{rn height: auto !important;rn }rnrn .logobrain{rn height: 40vh !important;rn width: 40vh !important;rn }rn} ", "",{"version":3,"sources":["webpack://./src/index.css"],"names":[],"mappings":"AAAA;EACE,oCAAoC;EACpC,aAAa;AACf;;AAEA;EACE,oCAAoC;EACpC,+CAA+C;EAC/C,4BAA4B;EAC5B,uHAAuH;AACzH;;AAEA;EACE,yBAAyB;EACzB,eAAe;AACjB;;AAEA;EACE,uBAAuB;EACvB,oCAAoC;EACpC,+BAA+B;EAC/B,gCAAgC;AAClC;;AAEA;EACE,8BAA8B;AAChC;;AAEA;EACE;IACE,uBAAuB;EACzB;;EAEA;IACE,uBAAuB;IACvB,sBAAsB;EACxB;AACF","sourcesContent":[".font-msg {rn font-family: 'Hanalei Fill', cursive;rn border: 100px;rn}rnrn.skillHover:hover{rn background-color: #ebebeb !important;rn border-left: 10px solid midnightblue !important;rn border-radius: 0% !important;rn box-shadow: rgba(17, 17, 26, 0.1) 0px 4px 16px, rgba(17, 17, 26, 0.1) 0px 8px 24px, rgba(17, 17, 26, 0.1) 0px 16px 56px;rn}rnrn.textSkill{rn color: rgb(124, 124, 124);rn font-size: 1rem;rn}rnrn.contact{rn margin: auto !important;rn background-color: #ebebeb !important;rn background:'#f1f1f1' !important;rn border-radius:'10px' !important;rn}rnrn.text404{rn color: midnightblue !important;;rn}rnrn@media (max-width: 700px){rn .image{rn height: auto !important;rn }rnrn .logobrain{rn height: 40vh !important;rn width: 40vh !important;rn }rn} "],"sourceRoot":""}]);
12 | // Exports
13 | ___CSS_LOADER_EXPORT___.locals = {};
14 | /* harmony default export */ __webpack_exports__.d.e.f.a.u.l.t = (___CSS_LOADER_EXPORT___);
15 |
I check my package.json
"dependencies": {
"@emotion/react": "^11.6.0",
"@emotion/styled": "^11.6.0",
"@fontsource/roboto": "^4.5.1",
"@material-ui/core": "^4.12.3",
"@material-ui/icons": "^4.11.2",
"@mui/material": "^5.1.1",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^12.8.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-responsive-image": "^5.0.0",
"react-router-dom": "^5.3.0",
"react-scripts": "^5.0.1",
"react-tooltip": "^4.2.21",
"responsive-img-material-ui": "^2.2.0",
"web-vitals": "^1.1.2"
},
I’m thinking it’s ok, why I’m getting errors when I run build??
I tried deleting folder node_modules, and didn’t work, then I tried deleting package-lock.json file and did’t work too.
2
Answers
Downgrade to 5.82.1
Here you can see the discussion: https://github.com/webpack/webpack/issues/17213
I confirm it worked:
add in the package.json
for npm
for yarn
This has been fixed in Webpack 5.83.1.