首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Angular CLI停止在浏览器控制台中给我提供敏感的行(无源地图),但终端显示正确的源

Angular CLI停止在浏览器控制台中给我提供敏感的行(无源地图),但终端显示正确的源
EN

Stack Overflow用户
提问于 2019-06-20 03:10:43
回答 1查看 656关注 0票数 1

几天前,我注意到我的Angular with Angular CLI项目停止给我一个合理的错误行。取而代之的是,我从main.jsvendor.js和所有其他编译过的代码文件中得到代码行。在我的终端中,它给了我一个“正常”的错误和未编译代码中的正确行。

此外,浏览器控制台中的console.log()来自编译后的代码。我不知道是什么改变了,这是否是故意的?我检查了我的环境,它在开发模式下运行。我已经更新了Angular CLI和Angular本身,但都没有用。

我运行以下命令来打开一个本地主机:

ng serve --open

这是我的package.json:

代码语言:javascript
复制
{
  "name": "fqm19",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "deploy": "node deploy"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^8.0.2",
    "@angular/cdk": "^7.3.7",
    "@angular/common": "~8.0.2",
    "@angular/compiler": "~8.0.2",
    "@angular/core": "~8.0.2",
    "@angular/fire": "^5.2.1",
    "@angular/forms": "~8.0.2",
    "@angular/platform-browser": "~8.0.2",
    "@angular/platform-browser-dynamic": "~8.0.2",
    "@angular/router": "~8.0.2",
    "angular-sortablejs": "^2.7.0",
    "angular2-fontawesome": "^5.2.1",
    "bootstrap": "^4.3.1",
    "cookieconsent": "^3.1.0",
    "core-js": "^2.5.4",
    "firebase": "^6.1.1",
    "font-awesome": "^4.7.0",
    "ng2-adsense": "^5.4.2",
    "ngx-bootstrap": "^4.0.1",
    "ngx-cookieconsent": "^2.2.0",
    "ngx-toastr": "^10.0.4",
    "pdfmake": "^0.1.55",
    "rxjs": "~6.5.2",
    "sortablejs": "^1.9.0",
    "tslib": "^1.9.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.800.0",
    "@angular/cli": "~8.0.3",
    "@angular/compiler-cli": "~8.0.2",
    "@angular/language-service": "~8.0.2",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "^5.0.1",
    "ftp-deploy": "^2.3.3",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "~3.4.5"
  }
}

有谁能解释一下这个变化吗?还是我错过了什么?哦,是的,我已经丢弃了我所有的节点模块,并重新安装了一切。还是老样子。

Angular.json:

代码语言:javascript
复制
{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "fqm19": {
      "root": "",
      "sourceRoot": "src",
      "projectType": "application",
      "prefix": "app",
      "schematics": {},
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "src/tsconfig.app.json",
            "assets": [
              "src/favicon.ico",
              "src/ads.txt",
              "src/assets"
            ],
            "styles": [
              "node_modules/bootstrap/dist/css/bootstrap.min.css",
              "node_modules/cookieconsent/build/cookieconsent.min.css",
              "node_modules/ngx-toastr/toastr.css",
              "src/styles.css",
              "node_modules/font-awesome/css/font-awesome.css"
            ],
            "scripts": [
              "node_modules/cookieconsent/build/cookieconsent.min.js"
            ],
            "es5BrowserSupport": true
          },
          "configurations": {
            "production": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ],
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "2mb",
                  "maximumError": "5mb"
                }
              ]
            }
          }
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "fqm19:build"
          },
          "configurations": {
            "production": {
              "browserTarget": "fqm19:build:production"
            }
          }
        },
        "extract-i18n": {
          "builder": "@angular-devkit/build-angular:extract-i18n",
          "options": {
            "browserTarget": "fqm19:build"
          }
        },
        "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "src/test.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "src/tsconfig.spec.json",
            "karmaConfig": "src/karma.conf.js",
            "styles": [
              "src/styles.css"
            ],
            "scripts": [],
            "assets": [
              "src/favicon.ico",
              "src/assets"
            ]
          }
        },
        "lint": {
          "builder": "@angular-devkit/build-angular:tslint",
          "options": {
            "tsConfig": [
              "src/tsconfig.app.json",
              "src/tsconfig.spec.json"
            ],
            "exclude": [
              "**/node_modules/**"
            ]
          }
        }
      }
    },
    "fqm19-e2e": {
      "root": "e2e/",
      "projectType": "application",
      "prefix": "",
      "architect": {
        "e2e": {
          "builder": "@angular-devkit/build-angular:protractor",
          "options": {
            "protractorConfig": "e2e/protractor.conf.js",
            "devServerTarget": "fqm19:serve"
          },
          "configurations": {
            "production": {
              "devServerTarget": "fqm19:serve:production"
            }
          }
        },
        "lint": {
          "builder": "@angular-devkit/build-angular:tslint",
          "options": {
            "tsConfig": "e2e/tsconfig.e2e.json",
            "exclude": [
              "**/node_modules/**"
            ]
          }
        }
      }
    }
  },
  "defaultProject": "fqm19",
  "schematics": {
    "@schematics/angular:component": {
      "styleext": "css"
    }
  }
}
EN

回答 1

Stack Overflow用户

发布于 2019-06-20 03:20:41

检查angular.json文件是否包含sourceMaps标志,以及开发时是否将其设置为true。默认情况下,它在生产中是禁用的(跳过生产中的调试是有意义的),但可能有人在您不知情的情况下更新了您的angular.json配置。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56674390

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档