Chrome 为什么浏览器每30秒自动刷新一次项目?

az31mfrm  于 2023-09-28  发布在  Go
关注(0)|答案(1)|浏览(152)

我有一个angular项目,当它在服务器上时工作正常,但在localHost上,它自动每30秒刷新一次浏览器
我没有写任何刷新页面的代码,比如像window.location.reload()这样的代码
我测试了浏览器像
Chrome
火狐边缘和他们有同样的问题
我用commandPrompt运行项目,它仍然有问题
我还通过commandPrompt本身运行了vscode,它出现了问题,页面刷新
不知道是不是和浏览器缓存有关系,我也删了,可惜问题没有解决
最后,刷新时,控制台上会打印此错误,并重新加载页面

在我的Angular软件包版本中,它是这样的

"dependencies": {
    "@angular/animations": "^12.2.16",
    "@angular/cdk": "^12.2.13",
    "@angular/common": "^12.2.16",
    "@angular/compiler": "^12.2.16",
    "@angular/core": "^12.2.16",
    "@angular/forms": "^12.2.16",
    "@angular/localize": "^12.2.16",
    "@angular/material": "^12.2.13",
    "@angular/platform-browser": "^12.2.16",
    "@angular/platform-browser-dynamic": "^12.2.16",
    "@angular/router": "^12.2.16",
    "@angular/service-worker": "^12.2.16",
    "@aspnet/signalr": "^3.0.0-preview6.19307.2",
    "@asymmetrik/ngx-leaflet": "8.1.0",
    "@circlon/angular-tree-component": "^11.0.4",
    "@formio/angular": "^5.3.0",
    "@fortawesome/angular-fontawesome": "^0.9.0",
    "@fortawesome/fontawesome-svg-core": "^6.2.0",
    "@fortawesome/free-brands-svg-icons": "^5.15.3",
    "@fortawesome/free-regular-svg-icons": "^5.15.3",
    "@fortawesome/free-solid-svg-icons": "^6.2.0",
    "@fullcalendar/angular": "^5.1.0",
    "@fullcalendar/core": "^5.1.0",
    "@fullcalendar/daygrid": "^5.1.0",
    "@fullcalendar/interaction": "^5.1.0",
    "@fullcalendar/list": "^5.1.0",
    "@fullcalendar/timegrid": "^5.1.0",
    "@iplab/ngx-color-picker": "^2.1.1",
    "@microsoft/signalr": "^5.0.5",
    "@nebular/eva-icons": "^7.0.0",
    "@nebular/theme": "7.0.0",
    "@ng-bootstrap/ng-bootstrap": "10.0.0",
    "@ngrx/effects": "^11.1.0",
    "@ngrx/store": "^11.1.0",
    "@ngx-translate/core": "^13.0.0",
    "@ngx-translate/http-loader": "^6.0.0",
    "@swimlane/ngx-charts": "^17.0.1",
    "@types/codemirror": "0.0.108",
    "ag-grid": "^18.1.2",
    "angular-gauge": "^4.0.0",
    "angular-gauge-chart": "^0.7.2",
    "angular-google-charts": "^2.2.1",
    "angular-gridster2": "^11.1.5",
    "angular-oauth2-oidc": "^12.1.0",
    "angular-responsive-carousel": "^2.1.2",
    "angular2-toaster": "^11.0.1",
    "bootstrap": "^5.1.3",
    "chart.js": "^3.9.1",
    "chartjs-plugin-datalabels": "^1.0.0",
    "chartjs-plugin-zoom": "^1.2.1",
    "classlist.js": "1.1.20150312",
    "codemirror": "^5.60.0",
    "core-js": "3.10.1",
    "eva-icons": "^1.1.3",
    "flag-icon-css": "^3.5.0",
    "font-awesome": "^4.7.0",
    "fontawesome-4.7": "^4.7.0",
    "formiojs": "^4.14.8",
    "gulp-brotli": "^3.0.0",
    "gulp-clean": "^0.4.0",
    "gulp-filter": "^7.0.0",
    "gulp-gzip": "^1.4.2",
    "gulp-purify-css": "^0.1.0",
    "gulp-rename": "^2.0.0",
    "html-to-image": "^1.11.11",
    "html-to-pdfmake": "^2.4.16",
    "html-webpack-plugin": "^5.5.0",
    "intro.js": "^6.0.0",
    "jalali-moment": "^3.3.11",
    "jquery": "^3.6.0",
    "jqwidgets-ng": "^12.0.4",
    "jspdf": "^2.5.1",
    "leaflet": "1.7.1",
    "linq": "^3.2.3",
    "lodash": "^4.17.21",
    "material-jalali-moment-adapter": "^4.0.0",
    "moment-duration-format": "^2.3.2",
    "moment-jalaali": "^0.9.6",
    "ng-multiselect-dropdown": "^0.3.4",
    "ng-zorro-antd": "^11.4.2",
    "ng2-dnd": "^5.0.2",
    "ng2-jalali-date-picker": "^2.4.2",
    "ng2-tooltip-directive": "~2.9.22",
    "ngx-bootstrap": "^6.2.0",
    "ngx-color": "^7.3.3",
    "ngx-color-picker": "^11.0.0",
    "ngx-filesize": "^2.0.16",
    "ngx-infinite-scroll": "^6.9.1",
    "ngx-loading": "^8.0.0",
    "ngx-material-timepicker": "^5.5.3",
    "ngx-permissions": "^8.1.1",
    "ngx-persian": "^1.3.2",
    "ngx-sortablejs": "^11.1.0",
    "ngx-spinner": "^12.0.0",
    "ngx-toastr": "^13.2.1",
    "ngx-ui-switch": "^11.0.1",
    "npm": "^7.9.0",
    "pdfmake": "^0.2.7",
    "primeflex": "^3.2.1",
    "primeicons": "^5.0.0",
    "primeng": "^12.2.3",
    "quill": "^1.3.7",
    "rxjs": "^6.6.7",
    "rxjs-compat": "^6.6.7",
    "sortablejs": "^1.13.0",
    "sweetalert2": "^10.16.2",
    "swiper": "^6.8.4",
    "tslib": "^2.2.0",
    "web-animations-js": "^2.3.2",
    "webpack": "^4.44.2",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^12.2.18",
    "@angular/cli": "^12.2.18",
    "@angular/compiler-cli": "^12.2.16",
    "@biesbjerg/ngx-translate-extract": "^7.0.4",
    "@compodoc/compodoc": "^1.1.19",
    "@types/intro.js": "^5.1.0",
    "@types/lodash": "^4.14.184",
    "@types/node": "^14.14.39",
    "autoprefixer": "^10.4.7",
    "conventional-changelog-cli": "2.1.1",
    "gulp": "^4.0.2",
    "gulp-util": "^3.0.8",
    "gulp-zip": "^5.1.0",
    "jasmine-core": "~3.7.1",
    "jasmine-spec-reporter": "~7.0.0",
    "json-server": "^0.17.1",
    "karma": "^6.3.17",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~3.0.3",
    "karma-jasmine": "~4.0.1",
    "karma-jasmine-html-reporter": "^1.5.4",
    "postcss": "^8.4.14",
    "protractor": "~7.0.0",
    "rimraf": "3.0.2",
    "stylelint": "13.12.0",
    "ts-node": "^9.1.1",
    "tslint": "~6.1.0",
    "typescript": "~4.3.5"
  }

我觉得我的问题是浏览器本身,因为我用localhost:4200运行了另一个项目,问题是一样的。

von4xj4u

von4xj4u1#

使用此命令运行项目

ng serve --live-reload=false

相关问题