简体   繁体   English

保存代码更改后,React App 不会重新加载

[英]React App is not reloading when code changes are saved

When i do some updates on the code and save them the react app seems not to be functional, it stops and the mouse clicks seems not to be working.当我对代码进行一些更新并保存它们时,反应应用程序似乎无法正常工作,它停止并且鼠标点击似乎不起作用。 I'm obliged to manually refresh the page.我不得不手动刷新页面。 This is my package.json:这是我的 package.json:

  "dependencies": {
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^12.8.3",
"@webiny/ui": "^5.22.1",
"axios": "^0.21.1",
"firebase": "^9.6.10",
"material-ui": "^0.20.2",
"moment": "^2.29.3",
"npm": "^7.7.6",
"react": "^16.14.0",
"react-accessible-accordion": "^4.0.0",
"react-bootstrap": "^1.6.4",
"react-chartjs-2": "^4.1.0",
"react-dom": "^17.0.1",
"react-firebaseui": "^4.1.0",
"react-fontawesome": "^1.7.1",
"react-giphy-picker": "^1.1.1",
"react-icons": "^4.3.1",
"react-modal": "^3.14.3",
"react-paginate": "^7.1.3",
"react-redux": "^8.0.0",
"react-router-dom": "^5.3.1",
"redux": "^4.2.0",
    "web-vitals": "^1.1.1"
  },

  "scripts": {
    "start": "PORT=5000 react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },

I'm using VS code on linux Ubuntu 20我在 linux Ubuntu 20 上使用 VS 代码

Try doing the the following changes.尝试进行以下更改。

If you're using npm如果您使用的是 npm

  "overrides" : {
   "react-error-overlay": "6.0.9"
   }

If you are using yarn如果您使用的是纱线

   "resolutions" : {
     "react-error-overlay": "6.0.9"
   }

After doing this, do install the packages once again and re-start the app.完成此操作后,再次安装软件包并重新启动应用程序。 This should help这应该有帮助

Tips on VS Code: You can enable autosave, so when any change code in your codebase, VS Code will automatically do it for you and you don't need to do it manually every time. VS Code 小贴士:您可以启用自动保存,这样当您的代码库中有任何更改代码时,VS Code 会自动为您完成,您无需每次都手动执行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 nginx 反向代理后的 create-react-app 代码更改未在浏览器中重新加载 - create-react-app code changes behind nginx reverse proxy not reloading in browser 反应故事书不会在更改时重新加载 - React storybook not reloading on changes Docker-compose 与 WSL 2 React 应用程序不会在更改时热重新加载 - Docker-compose with WSL 2 React app not hot reloading on changes HTML 设置复选框并在 React + Bootstrap 中更改页面时未保存更改 - HTML changes are not saved when a checkbox is set and the page is changed in React + Bootstrap Flask React App无法热装 - Flask React App not Hot Reloading 当我的React app中的路由发生变化时,我的clearInterval()和应用程序中断了 - when route changes in my React app I clearInterval() and app breaks 创建未对代码进行任何更改的反应应用程序测试不运行 - create react app tests not running without any changes to the code 在开发中创建不使用 Express 重新加载的 React App - Create React App not reloading with Express in development 我的 React 应用程序不会在浏览器中自动重新加载 - my React app is not auto reloading in the browser 使用 express 服务器在 React 应用程序中热重载 - Hot reloading in a React app with express server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM