簡體   English   中英

ReactJS 隨機意外的令牌'<'

[英]ReactJS randomly Unexpected token '<'

項目是使用 create-react-app 創建的。 沒有彈出。 沒有 webpack 配置。 默認"react-scripts": "^3.4.0" dev版本上沒有錯誤。 但是在生產中,當用戶長時間停留在一個頁面上並單擊鏈接時,它會顯示白頁,並且在更新站點(部署新版本)之后。 這個錯誤是隨機出現的。 控制台輸出

意外標記“<”

並且沒有其他信息。

有我的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",
  }
}

不知道怎么樣但是在啟用sourcemap此錯誤不會顯示。 我從yarn build刪除了這個命令:

GENERATE_SOURCEMAP=false

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM