2

Project was created with create-react-app. Did not eject. There are no webpack configs. Default "react-scripts": "^3.4.0". On dev version there is no error. But on production when user stays long on one page and clicks the link it shows white page, and after updating the site(deploying new version). This error randomly appears. Output on console

Unexpected token '<'

and no other information.

There is my package.json

{
  "name": "project-name",
  "version": "2.0.0",
  "description": "description",
  "private": true,
  "dependencies": {
    "@bugsnag/js": "^6.5.0",
    "@bugsnag/plugin-react": "^6.5.0",
    "@glidejs/glide": "^3.4.1",
    "@material-ui/core": "^4.4.1",
    "@sentry/browser": "^5.11.2",
    "@sentry/cli": "^1.49.0",
    "@types/jest": "^25.1.3",
    "@types/node": "^13.7.4",
    "@types/rc-switch": "^1.9.0",
    "@types/react": "^16.9.22",
    "@types/react-dom": "^16.9.5",
    "axios": "^0.19.0",
    "chart.js": "^2.9.1",
    "classnames": "2.2.6",
    "debounce-promise": "^3.1.2",
    "formik": "^1.5.8",
    "jquery": "^3.4.1",
    "logrocket": "^1.0.6",
    "logrocket-react": "^4.0.1",
    "moment": "2.24.0",
    "moment-timezone": "^0.5.27",
    "orgchart": "^2.1.5",
    "prop-types": "^15.7.2",
    "purgecss": "^1.4.0",
    "rc-switch": "^1.9.0",
    "react": "^16.9.0",
    "react-autosuggest": "^9.4.3",
    "react-chartjs-2": "^2.7.6",
    "react-circular-progressbar": "^2.0.2",
    "react-contextmenu": "^2.11.0",
    "react-data-export": "^0.6.0",
    "react-datepicker": "^2.9.6",
    "react-dom": "^16.9.0",
    "react-dropzone-component": "^3.2.0",
    "react-intl": "2.4.0",
    "react-perfect-scrollbar": "^1.5.3",
    "react-redux": "7.1.1",
    "react-router-dom": "^5.0.1",
    "react-scripts": "^3.4.0",
    "react-select": "^3.0.4",
    "react-select-async-paginate": "^0.3.10",
    "react-table": "latest",
    "react-transition-group": "^4.3.0",
    "reactstrap": "^8.0.1",
    "redux": "^4.0.4",
    "redux-saga": "^1.0.5",
    "styled-components": "^5.0.0",
    "tailwindcss": "^1.1.2",
    "typescript": "^3.8.2",
    "xlsx": "^0.15.5",
    "yup": "^0.27.0"
  },
  "scripts": {
    "start": "yarn run tailwind && react-scripts start",
    "build": "yarn run tailwind && node ./purge-tailwindcss.js && cross-env react-scripts build",
    "tailwind": "./node_modules/.bin/tailwind build ./src/assets/css/vendor/tailwind.base.css -c ./tailwind.js -o ./src/assets/css/vendor/tailwind.css",
    "test": "react-scripts test --env=node",
    "crt": "bash create-component.sh",
    "eject": "react-scripts eject",
    "lint": "eslint src/**/*.js"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": [
    ">0.2%",
    "not dead",
    "not ie <= 11",
    "not op_mini all"
  ],
  "devDependencies": {
    "babel-plugin-import": "^1.13.0",
    "cross-env": "^5.2.0",
    "eslint": "^6.8.0",
    "eslint-config-airbnb": "^18.0.1",
    "eslint-plugin-import": "^2.20.0",
    "eslint-plugin-jsx-a11y": "^6.2.3",
    "eslint-plugin-react": "^7.18.0",
    "eslint-plugin-react-hooks": "^1.7.0",
    "node-sass": "^4.12.0",
  }
}
4

1 回答 1

1

不知道怎么样。但启用sourcemap此错误后未显示。我从以下位置删除了这个命令yarn build

GENERATE_SOURCEMAP=false
于 2020-03-05T12:56:51.867 回答