我得到这个错误:JavaScript Error: {"type":"js.error","error":{"message":"Uncaught SyntaxError: Unexpected token ?","url":"http://localhost/vendor.js","line":24288,"col":28,"errorObject":"{}"}} File: http://localhost/ - Line 582 - Msg: SyntaxError: Unexpected token ? File: http://localhost/vendor.js - Line 24288 - Msg: Uncaught SyntaxError: Unexpected token ?
当我在Android模拟器中运行应用程序时。应用程序不想启动,只是崩溃并在Logcat中显示此错误。我打开了该文件,这是我在该行中找到的内容:this._baseHref = href ?? this._platformLocation.getBaseHrefFromDOM() ?? (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(DOCUMENT).location?.origin ?? '';
,属于以下内容:class PathLocationStrategy extends LocationStrategy
如果有帮助,我可以与你分享vendor.js
文件。但请帮助我或帮助我解决谁是负责它。
这是我的包裹. json:"dependencies": { "@angular/common": "^14.2.3", "@angular/core": "^14.2.3", "@angular/forms": "^14.2.3", "@angular/platform-browser": "^14.2.3", "@angular/platform-browser-dynamic": "^14.2.3", "@angular/router": "^14.2.3", "@capacitor/android": "^4.3.0", "@capacitor/app": "^4.0.1", "@capacitor/core": "^4.3.0", "@capacitor/filesystem": "^4.1.1", "@capacitor/haptics": "^4.0.0", "@capacitor/ios": "^4.3.0", "@capacitor/keyboard": "^4.0.0", "@capacitor/status-bar": "^4.0.0", "@ionic-native/camera": "^5.36.0", "@ionic-native/core": "^5.36.0", "@ionic-native/file": "^5.36.0", "@ionic-native/splash-screen": "^5.36.0", "@ionic-native/status-bar": "^5.36.0", "@ionic/angular": "^6.2.9", "@ngx-translate/core": "^14.0.0", "@ngx-translate/http-loader": "^7.0.0", "animate.css": "^4.1.1", "cordova-plugin-camera": "^6.0.0", "cordova-plugin-file": "^7.0.0", "date-fns": "^2.29.0", "ionic-selectable": "^4.9.0", "rxjs": "~7.5.7", "tslib": "^2.4.0", "twilio-video": "^2.24.1", "zone.js": "~0.11.8" }, "devDependencies": { "@angular-devkit/architect": "^0.1402.4", "@angular-devkit/build-angular": "^14.2.3", "@angular-devkit/core": "^14.2.4", "@angular-eslint/builder": "~13.3.0", "@angular-eslint/eslint-plugin": "~13.3.0", "@angular-eslint/eslint-plugin-template": "~13.3.0", "@angular-eslint/template-parser": "~13.3.0", "@angular/cli": "^14.2.3", "@angular/compiler": "^14.2.3", "@angular/compiler-cli": "^14.2.3", "@angular/language-service": "^14.2.3", "@capacitor/cli": "^4.0.0", "@ionic/angular-toolkit": "^7.0.0", "@types/jasmine": "~3.6.0", "@types/jasminewd2": "~2.0.3", "@types/node": "^12.11.1", "@typescript-eslint/eslint-plugin": "4.16.1", "@typescript-eslint/parser": "4.16.1", "cordova-plugin-device": "^2.0.2", "cordova-plugin-ionic-keyboard": "^2.2.0", "cordova-plugin-ionic-webview": "^4.2.1", "cordova-plugin-splashscreen": "^5.0.2", "cordova-plugin-statusbar": "^2.4.2", "eslint": "^7.6.0", "eslint-plugin-import": "2.22.1", "eslint-plugin-jsdoc": "30.7.6", "eslint-plugin-prefer-arrow": "1.2.2", "jasmine-core": "~3.8.0", "jasmine-spec-reporter": "~5.0.0", "karma": "~6.3.2", "karma-chrome-launcher": "~3.1.0", "karma-coverage": "~2.0.3", "karma-coverage-istanbul-reporter": "~3.0.2", "karma-jasmine": "~4.0.0", "karma-jasmine-html-reporter": "^1.5.0", "protractor": "~7.0.0", "ts-node": "~10.9.1", "typescript": "~4.8.4" },
1条答案
按热度按时间cqoc49vn1#
tsconfig.json中的变更自:
"target": "es2020",
转换为:
"target": "es2015",
而且看起来都很好用!