Webpack не находит изображения после сборки - PullRequest
0 голосов
/ 19 ноября 2018

У меня есть проект (реактор-образец) с использованием зависимостей:

"dependencies": {
    "@trendmicro/react-radio": "^3.2.2",
    "babel-polyfill": "^6.23.0",
    "bootstrap": "^3.3.7",
    "case-sensitive-paths-webpack-plugin": "^2.1.2",
    "chalk": "^1.1.3",
    "chance": "^1.0.16",
    "compression": "^1.6.2",
    "console-browserify": "^1.1.0",
    "constants-browserify": "^1.0.0",
    "cross-env": "^5.0.0",
    "crypto-browserify": "^3.12.0",
    "css-select": "^2.0.2",
    "dom-converter": "^0.2.0",
    "domain-browser": "^1.2.0",
    "domelementtype": "^1.2.1",
    "draft-js": "^0.10.4",
    "draftjs-to-html": "^0.8.4",
    "express": "^4.15.3",
    "file-saver": "^1.3.8",
    "fontfaceobserver": "^2.0.9",
    "forever-agent": "^0.6.1",
    "glob": "^7.1.3",
    "gulp-util": "^3.0.8",
    "happypack": "^5.0.0",
    "history": "^4.6.3",
    "hoist-non-react-statics": "^2.1.1",
    "html-to-draftjs": "^1.4.0",
    "http-proxy-middleware": "^0.17.4",
    "https-browserify": "^1.0.0",
    "immutable": "^3.8.1",
    "inflight": "^1.0.6",
    "intl": "^1.2.5",
    "invariant": "^2.2.2",
    "ip": "^1.1.5",
    "jquery": "^1.12.4",
    "json-schema": "^0.2.3",
    "json-stable-stringify": "^1.0.1",
    "mime-db": "^1.37.0",
    "minimist": "^1.2.0",
    "moment": "2.18.1",
    "prop-types": "^15.6.0",
    "prr": "^1.0.1",
    "rc-checkbox": "^2.1.5",
    "react": "^16.6.3",
    "react-addons-css-transition-group": "^15.6.2",
    "react-bootstrap": "^0.32.4",
    "react-checkbox-tree": "^1.4.1",
    "react-datepicker": "^0.64.0",
    "react-dimensions": "^1.3.1",
    "react-dom": "^16.6.3",
    "react-draft-wysiwyg": "^1.12.13",
    "react-helmet": "^5.1.3",
    "react-input-mask": "^1.2.2",
    "react-intl": "^2.3.0",
    "react-loadable": "^4.0.3",
    "react-onclickoutside": "^6.7.1",
    "react-redux": "^5.0.5",
    "react-responsive-carousel": "^3.1.43",
    "react-router-dom": "^4.1.1",
    "react-router-redux": "^5.0.0-alpha.6",
    "react-select": "^1.3.0",
    "react-slick": "^0.23.2",
    "react-table": "^6.8.6",
    "react-tabs": "^2.3.0",
    "react-tether": "^1.0.4",
    "react-transition-group": "^1.2.1",
    "reactstrap": "^6.5.0",
    "recharts": "^1.4.1",
    "redux": "^3.6.0",
    "redux-immutable": "^4.0.0",
    "redux-saga": "^0.15.3",
    "redux-thunk": "^2.3.0",
    "reselect": "^3.0.1",
    "sanitize.css": "^4.1.0",
    "semantic-ui-react": "^0.75.1",
    "simple-react-form": "^2.1.5",
    "slick-carousel": "^1.8.1",
    "stream-http": "^3.0.0",
    "styled-components": "^2.0.0",
    "tether": "^1.4.5",
    "toposort": "^2.0.2",
    "warning": "^3.0.0",
    "whatwg-fetch": "^2.0.3"
  },
  "devDependencies": {
    "add-asset-html-webpack-plugin": "2.0.1",
    "babel-cli": "6.24.1",
    "babel-core": "6.24.1",
    "babel-eslint": "7.2.3",
    "babel-loader": "7.1.0",
    "babel-plugin-dynamic-import-node": "1.0.2",
    "babel-plugin-react-intl": "2.3.1",
    "babel-plugin-react-transform": "2.0.2",
    "babel-plugin-styled-components": "1.1.4",
    "babel-plugin-transform-es2015-modules-commonjs": "6.24.1",
    "babel-plugin-transform-react-constant-elements": "6.23.0",
    "babel-plugin-transform-react-inline-elements": "6.22.0",
    "babel-plugin-transform-react-remove-prop-types": "0.4.5",
    "babel-preset-env": "1.5.1",
    "babel-preset-react": "6.24.1",
    "babel-preset-stage-0": "6.24.1",
    "circular-dependency-plugin": "^3.0.0",
    "coveralls": "2.13.1",
    "css-loader": "0.28.4",
    "enzyme": "2.8.2",
    "eslint": "3.19.0",
    "eslint-config-airbnb": "15.0.1",
    "eslint-config-airbnb-base": "11.2.0",
    "eslint-import-resolver-webpack": "0.8.3",
    "eslint-plugin-import": "2.7.0",
    "eslint-plugin-jsx-a11y": "5.0.3",
    "eslint-plugin-react": "7.0.1",
    "eslint-plugin-redux-saga": "0.3.0",
    "eventsource-polyfill": "0.9.6",
    "exports-loader": "0.6.4",
    "file-loader": "^0.11.1",
    "html-loader": "0.4.5",
    "html-webpack-plugin": "2.29.0",
    "image-webpack-loader": "^2.0.0",
    "imports-loader": "0.7.1",
    "jest-cli": "20.0.4",
    "lint-staged": "3.5.1",
    "ngrok": "2.2.9",
    "node-plop": "0.7.0",
    "node-sass": "^4.5.3",
    "null-loader": "0.1.1",
    "offline-plugin": "4.8.1",
    "plop": "1.8.0",
    "pre-commit": "1.2.2",
    "react-iframe": "^1.0.7",
    "react-test-renderer": "16.0.0",
    "rimraf": "2.6.1",
    "sass-loader": "^6.0.6",
    "shelljs": "0.7.7",
    "style-loader": "0.18.1",
    "url-loader": "0.5.8",
    "webpack": "^3.5.5",
    "webpack-dev-middleware": "1.11.0",
    "webpack-hot-middleware": "2.18.0"
  }

Я не уверен, сломана ли библиотека или нет, но при компиляции проекта я получаю следующие ошибки:

// This error comes from embedded library which is slick-carousel
ERROR in ./node_modules/slick-carousel/slick/ajax-loader.gif
Module build failed: Error: The system cannot find the path specified.

    at notFoundError (C:\Users\dk0348\git\dashboard-project\ocf-dashboard-service\src\main\javascript\node_modules\execa\node_modules\cross-spawn\lib\enoent.js:11:11)
    at verifyENOENT (C:\Users\dk0348\git\dashboard-project\ocf-dashboard-service\src\main\javascript\node_modules\execa\node_modules\cross-spawn\lib\enoent.js:46:16)
    at ChildProcess.cp.emit (C:\Users\dk0348\git\dashboard-project\ocf-dashboard-service\src\main\javascript\node_modules\execa\node_modules\cross-spawn\lib\enoent.js:33:19)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
 @ ./node_modules/css-loader!./node_modules/sass-loader/lib/loader.js!./node_modules/slick-carousel/slick/slick-theme.css 6:118-146
 @ ./node_modules/slick-carousel/slick/slick-theme.css
 @ ./app/global-styles.js
 @ ./app/app.js
 @ multi eventsource-polyfill webpack-hot-middleware/client?reload=true ./app/app.js

//This error comes from my image which is in app/images/loader.gif
ERROR in ./app/images/loader.gif
Module build failed: Error: The system cannot find the path specified.

    at notFoundError (C:\Users\dk0348\git\dashboard-project\ocf-dashboard-service\src\main\javascript\node_modules\execa\node_modules\cross-spawn\lib\enoent.js:11:11)
    at verifyENOENT (C:\Users\dk0348\git\dashboard-project\ocf-dashboard-service\src\main\javascript\node_modules\execa\node_modules\cross-spawn\lib\enoent.js:46:16)
    at ChildProcess.cp.emit (C:\Users\dk0348\git\dashboard-project\ocf-dashboard-service\src\main\javascript\node_modules\execa\node_modules\cross-spawn\lib\enoent.js:33:19)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
 @ ./app/components/ErgoLoader/index.js 16:0-39
 @ ./app/dashboard/containers/DashboardPage/Loadable.js
 @ ./app/containers/App/index.js
 @ ./app/app.js
 @ multi eventsource-polyfill webpack-hot-middleware/client?reload=true ./app/app.js

Приложение работало правильно, пока я не переустановил свои зависимости снова.Я не уверен, какая зависимость нарушена сейчас, потому что ошибка не ясна.Я также пытался npm rebuild node-sass, но результат тот же.

...