Heroku "npm run build" завершается ошибкой в ​​обработке SVG - PullRequest
0 голосов
/ 22 января 2019

Я пытаюсь развернуть приложение Rails + React (CRA) на Heroku, но оно терпит неудачу во время процесса сборки npm.Похоже, некоторые проблемы, связанные с обработкой SVG, но я понятия не имею, что это такое, так как это мое первое развертывание в Heroku с использованием SVG в React.

Этот проект не использует TS, возможно, это может быть как-то связано спроблема (маловероятная).

remote:        > react-scripts build
remote:
remote:        Creating an optimized production build...
remote:        Failed to compile.
remote:
remote:        ./src/icons/bathtub.svg (./node_modules/@svgr/webpack/lib?-prettier,-svgo!./src/icons/bathtub.svg)
remote:        /tmp/build_82ed3f6cbde426f6c9dc61dd68d32e7c/frontend/node_modules/@svgr/webpack/lib/index.js:35
remote:          const pBabelTransform = async jsCode => new Promise((resolve, reject) => {
remote:                                        ^^^^^^
remote:        SyntaxError: Unexpected identifier
remote:

package.json:

{
  "name": "frontend",
  "version": "0.1.0",
  "private": true,
  "proxy": "http://localhost:3001",
  "dependencies": {
    "@material-ui/core": "^3.8.1",
    "@material-ui/icons": "^3.0.1",
    "classnames": "^2.2.6",
    "react": "^16.7.0",
    "react-devise": "0.0.19",
    "react-dom": "^16.7.0",
    "react-redux": "^6.0.0",
    "react-router-dom": "^4.3.1",
    "react-scripts": "2.1.2",
    "react-slick": "^0.23.2",
    "redux": "^4.0.1",
    "redux-form": "^8.1.0",
    "slick-carousel": "^1.8.1"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": [
    ">0.2%",
    "not dead",
    "not ie <= 11",
    "not op_mini all"
  ]
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...