错误404 Ionic Deploy Impl http://localhost/plugins/cordova-plugin-ionic/dist/common.js [英] error 404 Ionic Deploy Impl http://localhost/plugins/cordova-plugin-ionic/dist/common.js

查看:52
本文介绍了错误404 Ionic Deploy Impl http://localhost/plugins/cordova-plugin-ionic/dist/common.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经构建了一个Ionic 4应用程序.一切正常,但是每当我从Android设备在Chrome调试窗口中启动应用程序时,都会收到以下错误消息:

I've built an Ionic 4 app. Everything works but I get the following error whenever I launch the app in the Chrome debug window from my android device:

Failed to load resource: the server responded with a status of 404 ()
polyfills.js:3040 Unhandled Promise rejection: Error Status 404: App not found ; Zone: <root> ; Task: Promise.then ; Value: Error: Error Status 404: App not found
    at IonicDeployImpl.<anonymous> (/plugins/cordova-plugin-ionic/dist/common.js:291)
    at step (/plugins/cordova-plugin-ionic/dist/common.js:37)
    at Object.next (/plugins/cordova-plugin-ionic/dist/common.js:18)
    at fulfilled (/plugins/cordova-plugin-ionic/dist/common.js:9)
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (polyfills.js:2749)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (polyfills.js:2508)
    at polyfills.js:3247
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (polyfills.js:2781)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (polyfills.js:2553)
    at drainMicroTaskQueue (polyfills.js:2959) Error: Error Status 404: App not found
    at IonicDeployImpl.<anonymous> (http://localhost/plugins/cordova-plugin-ionic/dist/common.js:291:35)
    at step (http://localhost/plugins/cordova-plugin-ionic/dist/common.js:37:23)
    at Object.next (http://localhost/plugins/cordova-plugin-ionic/dist/common.js:18:53)
    at fulfilled (http://localhost/plugins/cordova-plugin-ionic/dist/common.js:9:58)
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (http://localhost/polyfills.js:2749:26)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (http://localhost/polyfills.js:2508:43)
    at http://localhost/polyfills.js:3247:34
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (http://localhost/polyfills.js:2781:31)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (http://localhost/polyfills.js:2553:47)
    at drainMicroTaskQueue (http://localhost/polyfills.js:2959:35)
api.onUnhandledError @ polyfills.js:3040

我什至不确定它是否引起任何问题.我唯一真正的问题是,当我使用Google身份验证时,大约需要3分钟才能对用户进行身份验证.但是,这是使用Facebook的正常时间.

I'm not even sure if it's causing any issues. The only real issue I have is when I use Google authentication it takes around 3 minutes to authenticate a user. However, it's a normal time with facebook.

任何帮助将不胜感激.目前,我已经在Google上进行了彻底搜索,以寻求有关此问题的帮助.

Any help would greatly be appreciated. At this point I've searched Google thoroughly for help with this problem.

这是我的app.component

This is my app.component

  initializeApp() {
    if (!firebase.apps.length) {
      firebase.initializeApp(firebaseConfig);
      this.platform.ready().then(() => {
        const unsubscribe = firebase.auth().onAuthStateChanged( user => {
          if (!user) {
              this.router.navigateByUrl('login');
              this.statusBar.styleDefault();
              this.splashScreen.hide();
            unsubscribe();
           }  else {
              this.router.navigateByUrl('tabs/itinerary-feed');
              this.statusBar.styleDefault();
              this.splashScreen.hide();
            unsubscribe();
          }
        });

    });
    }
  }

添加其他信息...这会在出现错误之前运行:

Adding additional information...this runs before I get the error:

Angular is running in the development mode. Call enableProdMode() to enable the production mode.

/plugins/cordova-plugin-fcm-with-dependecy-updated/www/FCMPlugin.js:6 FCMPlugin.js: is created

/plugins/cordova-plugin-fcm-with-dependecy-updated/www/FCMPlugin.js:59 FCMPlugin Ready OK

vendor.js:114077 Ionic Native: deviceready event fired after 910 ms

api.ionicjs.com/apps/588dfcc3/channels/check-device:1 Failed to load resource: the server responded with a status of 404 ()

推荐答案

看起来构建成功,但是某些插件引起了错误.

It looks like the build succeeded but some plugin is causing the error.

首先,安装最新的应用程序脚本:

First, install the latest app-scripts:

npm install @ionic/app-scripts@latest --save-dev

应用脚本负责执行实际的构建任务,例如:

App-scripts are responsible for performing the actual building tasks like:

  • 并行执行多核处理任务以加快构建速度
  • 内存中文件转储和捆绑
  • 将源代码移植到ES5JavaScript

然后,删除node_modules&插件文件夹,然后再次运行" npm install "命令.

Then, remove the node_modules & plugin folder and run "npm install" command again.

更新

initializeApp() 
{
  this.platform.ready().then(() =>  //Fired when Ionic app is ready to listen to device specific events
  {
    this.statusBar.styleDefault();
    this.splashScreen.hide();

    if (!firebase.apps.length) 
    {
      firebase.initializeApp(firebaseConfig);
      const unsubscribe = firebase.auth().onAuthStateChanged( user => {
        if (!user) {
            this.router.navigateByUrl('login');
            //unsubscribe(); //I Can't understand this piece of code. It seems unnecessary here
         }  else {
            this.router.navigateByUrl('tabs/itinerary-feed');
             //unsubscribe();//I Can't understand this piece of code. It seems unnecessary here
        }
      });

    }


  });


}

这篇关于错误404 Ionic Deploy Impl http://localhost/plugins/cordova-plugin-ionic/dist/common.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆