首页 > 解决方案 > 带有Angular-map(agm)的İonic 3未捕获(承诺):TypeError:Object(...)不是函数

问题描述

我有使用 Angular 谷歌地图的 ionic 3 项目,经过一些更新后,地图页面出现问题,它说

未捕获(承诺):TypeError: Object(...) is not a function TypeError: Object(...) is not a function at new FitBoundsService

如何解决这个问题?

纽约环境。

离子:

ionic (Ionic CLI)  : 4.9.0 (/usr/local/lib/node_modules/ionic)
Ionic Framework    : ionic-angular 3.9.5
@ionic/app-scripts : 3.2.1

科尔多瓦:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms     : android 7.1.4, ios 4.5.5
Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.4.1, (and 13 other plugins)

系统:

ios-deploy : 1.9.2
NodeJS     : v8.12.0 (/usr/local/bin/node)
npm        : 6.9.0
OS         : macOS Mojave
Xcode      : Xcode 10.2.1 Build version 10E1001
  1. 我已将 agm/core 降级为 1.0.0-beta2 和 3
  2. 我已经安装了 rxjs 6 ,但它给了我更多的错误,因为我使用的是 angular 5。

这是 mu package.json

  "name": "xxx",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "start": "ionic-app-scripts serve",
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint"
  },
  "dependencies": {
    "@agm/core": "^1.0.0-beta.3",
    "@angular/animations": "5.2.11",
    "@angular/common": "5.2.11",
    "@angular/compiler": "5.2.11",
    "@angular/compiler-cli": "5.2.11",
    "@angular/core": "5.2.11",
    "@angular/forms": "5.2.11",
    "@angular/http": "5.2.11",
    "@angular/platform-browser": "5.2.11",
    "@angular/platform-browser-dynamic": "5.2.11",
    "@ionic-native/camera": "^4.20.0",
    "@ionic-native/core": "~4.20.0",
    "@ionic-native/device": "^4.20.0",
    "@ionic-native/facebook": "^4.20.0",
    "@ionic-native/geolocation": "^4.20.0",
    "@ionic-native/google-plus": "^4.20.0",
    "@ionic-native/in-app-browser": "^4.20.0",
    "@ionic-native/keyboard": "^4.20.0",
    "@ionic-native/launch-navigator": "^4.20.0",
    "@ionic-native/photo-viewer": "^4.20.0",
    "@ionic-native/screen-orientation": "^4.20.0",
    "@ionic-native/social-sharing": "^4.20.0",
    "@ionic-native/splash-screen": "~4.20.0",
    "@ionic-native/status-bar": "~4.20.0",
    "@ionic/storage": "2.2.0",
    "@ngx-translate/core": "^9.0.0",
    "@ngx-translate/http-loader": "^2.0.0",
    "@servicestack/client": "^1.0.15",
    "@types/googlemaps": "^3.30.16",
    "@types/node": "^11.9.4",
    "com-sarriaroman-photoviewer": "^1.2.2",
    "cordova-android": "7.1.4",
    "cordova-ios": "4.5.5",
    "cordova-plugin-actionsheet": "^2.3.3",
    "cordova-plugin-camera": "^4.0.3",
    "cordova-plugin-decimal-keyboard": "git+https://github.com/mrchandoo/cordova-plugin-decimal-keyboard.git",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-dialogs": "^2.0.1",
    "cordova-plugin-facebook4": "^4.2.1",
    "cordova-plugin-geolocation": "^4.0.1",
    "cordova-plugin-googleplus": "^7.0.1",
    "cordova-plugin-inappbrowser": "^3.0.0",
    "cordova-plugin-ionic-keyboard": "^2.1.3",
    "cordova-plugin-ionic-webview": "^2.4.1",
    "cordova-plugin-screen-orientation": "^3.0.1",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "cordova-plugin-x-socialsharing": "^5.4.4",
    "es6-promise-plugin": "^4.2.2",
    "ionic-angular": "^3.9.2",
    "ionic3-star-rating": "^1.1.5",
    "ionicons": "3.0.0",
    "is": "3.3.0",
    "moment": "^2.24.0",
    "ng2-simple-global": "^1.2.5",
    "ngx-moment": "^3.3.0",
    "q": "^1.5.1",
    "rxjs": "5.5.11",
    "socket.io-client": "^2.2.0",
    "sw-toolbox": "3.6.0",
    "uk.co.workingedge.phonegap.plugin.launchnavigator": "^5.0.4",
    "zone.js": "0.8.29"

标签: angularionic3ionic-nativeangular-google-maps

解决方案


推荐阅读