错误:未捕获(承诺):TypeError:Object(...)不是函数TypeError:Object(...)

时间:2019-12-27 12:57:45

标签: angular typescript ionic-framework

我在native上遇到了问题,并键入了音频。我抛出以下我附加的错误。尝试更新rxjs,但最终出现另一个 type.ts 错误,如果我没有记错的话,它就是version。你能帮我吗?

Runtime Error
Uncaught (in promise): TypeError: Object(...) is not a function TypeError: Object(...) is not a function at NativeAudio.preloadSimple (http://localhost:8100/build/vendor.js:82610:144) at new HomePage (http://localhost:8100/build/main.js:171:26) at createClass (http://localhost:8100/build/vendor.js:12808:20) at createDirectiveInstance (http://localhost:8100/build/vendor.js:12651:37) at createViewNodes (http://localhost:8100/build/vendor.js:14109:53) at createRootView (http://localhost:8100/build/vendor.js:13998:5) at callWithDebugContext (http://localhost:8100/build/vendor.js:15423:42) at Object.debugCreateRootView [as createRootView] (http://localhost:8100/build/vendor.js:14706:12) at ComponentFactory_.create (http://localhost:8100/build/vendor.js:11603:46) at ComponentFactoryBoundToModule.create (http://localhost:8100/build/vendor.js:4355:29)
Stack
Error: Uncaught (in promise): TypeError: Object(...) is not a function
TypeError: Object(...) is not a function
    at NativeAudio.preloadSimple (http://localhost:8100/build/vendor.js:82610:144)
    at new HomePage (http://localhost:8100/build/main.js:171:26)
    at createClass (http://localhost:8100/build/vendor.js:12808:20)
    at createDirectiveInstance (http://localhost:8100/build/vendor.js:12651:37)
    at createViewNodes (http://localhost:8100/build/vendor.js:14109:53)
    at createRootView (http://localhost:8100/build/vendor.js:13998:5)
    at callWithDebugContext (http://localhost:8100/build/vendor.js:15423:42)
    at Object.debugCreateRootView [as createRootView] (http://localhost:8100/build/vendor.js:14706:12)
    at ComponentFactory_.create (http://localhost:8100/build/vendor.js:11603:46)
    at ComponentFactoryBoundToModule.create (http://localhost:8100/build/vendor.js:4355:29)
    at c (http://localhost:8100/build/polyfills.js:3:19752)
    at c (http://localhost:8100/build/polyfills.js:3:19461)
    at http://localhost:8100/build/polyfills.js:3:20233
    at t.invokeTask (http://localhost:8100/build/polyfills.js:3:15660)
    at Object.onInvokeTask (http://localhost:8100/build/vendor.js:5076:33)
    at t.invokeTask (http://localhost:8100/build/polyfills.js:3:15581)

存档TS

import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { NativeAudio } from '@ionic-native/native-audio/ngx';


@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {

 constructor(public navCtrl: NavController,private nativeAudio: NativeAudio) {
               this.nativeAudio.preloadSimple('tigre', 'assets/sonidos/tigre.mp3');
               this.nativeAudio.preloadSimple('mono', 'assets/sonidos/mono.mp3');
               this.nativeAudio.preloadSimple('cerdo', 'assets/sonidos/cerdo.mp3');
               this.nativeAudio.preloadSimple('gallo', 'assets/sonidos/gallo.mp3');
               this.nativeAudio.preloadSimple('buho', 'assets/sonidos/buho.mp3');
               this.nativeAudio.preloadSimple('vaca', 'assets/sonidos/vaca.mp3');
               this.nativeAudio.preloadSimple('zorro', 'assets/sonidos/zorro.mp3');
               this.nativeAudio.preloadSimple('tortuga', 'assets/sonidos/tortuga.mp3');
               this.nativeAudio.preloadSimple('elefante', 'assets/sonidos/elefante.mp3');
               this.nativeAudio.preloadSimple('perro', 'assets/sonidos/perro.mp3');
               this.nativeAudio.preloadSimple('gato', 'assets/sonidos/gato.mp3');
               this.nativeAudio.preloadSimple('pinguino', 'assets/sonidos/pinguino.mp3');
 }

0 个答案:

没有答案