geowarin / friendly-errors-webpack-plugin

Recognizes certain classes of webpack errors and cleans, aggregates and prioritizes them to provide a better Developer Experience.
MIT License
749 stars 77 forks source link

Cannot read property 'request' of undefined at transform #112

Open pepies opened 4 years ago

pepies commented 4 years ago

https://github.com/geowarin/friendly-errors-webpack-plugin/blob/51745900c9dcc582aa250033a856216ca2f64377/src/transformers/moduleNotFound.js#L17 Hi, I dont examinated which module did not had options. But probably it was our company custom components package. Or maybe it was the package named "0" (string zero) that npm suggested me to install. Anyway it should be nice to handle also that kind or errors at some layer.

TypeError: Cannot read property 'request' of undefined
    at transform (/srv/www/node_modules/friendly-errors-webpack-plugin/src/transformers/moduleNotFound.js:17:61)
    at transform (/srv/www/node_modules/friendly-errors-webpack-plugin/src/core/transformErrors.js:28:45)
    at Array.reduce (<anonymous>)
    at applyTransformations (/srv/www/node_modules/friendly-errors-webpack-plugin/src/core/transformErrors.js:29:56)
    at Array.map (<anonymous>)
    at processErrors (/srv/www/node_modules/friendly-errors-webpack-plugin/src/core/transformErrors.js:31:35)
    at FriendlyErrorsWebpackPlugin.displayErrors (/srv/www/node_modules/friendly-errors-webpack-plugin/src/friendly-errors-plugin.js:97:29)
    at doneFn (/srv/www/node_modules/friendly-errors-webpack-plugin/src/friendly-errors-plugin.js:52:14)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/srv/www/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:7:1)
    at AsyncSeriesHook.lazyCompileHook (/srv/www/node_modules/tapable/lib/Hook.js:154:20)
    at /srv/www/node_modules/webpack/lib/Compiler.js:304:22
    at Compiler.emitRecords (/srv/www/node_modules/webpack/lib/Compiler.js:499:39)
    at /srv/www/node_modules/webpack/lib/Compiler.js:298:10
    at /srv/www/node_modules/webpack/lib/Compiler.js:485:14
    at _next0 (eval at create (/srv/www/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:14:1)
    at eval (eval at create (/srv/www/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:22:1)
    at /srv/www/node_modules/assets-webpack-plugin/dist/index.js:156:9
    at /srv/www/node_modules/assets-webpack-plugin/dist/lib/output/createQueuedWriter.js:16:7
    at /srv/www/node_modules/assets-webpack-plugin/dist/lib/output/createOutputWriter.js:74:13
    at /srv/www/node_modules/graceful-fs/graceful-fs.js:57:14
    at FSReqCallback.oncomplete (fs.js:154:23)
error Command failed with exit code 1.

Thanks. I had already solved the issue hacky way, this is just report.

pepies commented 4 years ago
  "dependencies": {
    "axios": "^0.19.0",
    "bootstrap": "^4.3.1",
    "classnames": "^2.2.6",
    "dateformat": "^2.0.0",
    "deep-freeze": "0.0.1",
    "empty": "^0.10.1",
    "flatpickr": "^4.6.3",
    "font-awesome": "^4.6.3",
    "fuse.js": "^3.4.5",
    "lodash": "^4.17.15",
    "moment": "^2.24.0",
    "prop-types": "^15.7.2",
    "raf": "^3.4.1",
    "react": "^16.8.3",
    "react-bootstrap": "^1.0.0-beta.8",
    "react-cookie": "2.2.0",
    "react-custom-scrollbars": "^4.2.1",
    "react-dom": "^16.8.6",
    "react-infinite-scroller": "^1.2.4",
    "react-month-picker-input": "^1.3.4",
    "react-notify": "^3.0.0",
    "react-notify-toast": "^0.5.1",
    "react-redux": "^4.4.9",
    "react-redux-loading-bar": "^4.2.0",
    "react-router-dom": "^4.3.1",
    "react-router-redux": "^4.0.7",
    "react-scroll-to-component": "^1.0.2",
    "react-select": "^1.3.0",
    "react-transition-group": "^4.0.1",
    "react-visibility-sensor": "^5.1.0",
    "redux": "^3.6.0",
    "redux-batched-subscribe": "^0.1.6",
    "redux-thunk": "^2.3.0",
    "reselect": "^2.5.4"
  },
  "devDependencies": {
    "@babel/core": "^7.0.0-0",
    "@babel/plugin-proposal-class-properties": "^7.5.5",
    "@babel/plugin-transform-runtime": "^7.6.2",
    "@babel/preset-env": "^7.6.3",
    "@babel/preset-react": "^7.0.0",
    "@babel/preset-typescript": "^7.7.0",
    "@symfony/webpack-encore": "^0.28.2",
    "@typescript-eslint/eslint-plugin": "^2.15.0",
    "@typescript-eslint/parser": "^2.15.0",
    "babel-eslint": "^10.0.2",
    "core-js": "^3.0.0",
    "css-loader": "^0.26.2",
    "dotenv": "^8.2.0",
    "eslint": "^6.5.1",
    "eslint-loader": "^2.1.2",
    "eslint-plugin-import": "^2.20.1",
    "eslint-plugin-jsx-a11y": "^6.2.3",
    "eslint-plugin-react": "^7.16.0",
    "eslint-plugin-react-hooks": "^2.1.2",
    "extract-text-webpack-plugin": "^3.0.2",
    "node-sass": "^4.13.1",
    "regenerator-runtime": "^0.13.2",
    "resolve-url-loader": "^2.3.2",
    "rimraf": "^2.6.3",
    "sass-loader": "^7.1.0",
    "style-loader": "^0.13.2",
    "ts-loader": "^5.3.0",
    "tslint": "^6.0.0",
    "typescript": "^3.7.5",
    "url-loader": "^2.0.1"
  }
pepies commented 4 years ago

I have fund the cause of this. Fortunately fatal at this point did not blocked webpack from its job. I have fund that iam importing something bad. bug was in code: import {Button} from '' I dont know who should handle this types of errors. probably each side ? Its upon you guyz