简体   繁体   English

离子-离子服务不起作用,空白页

[英]Ionic - Ionic Serve not working, blank page

I'm currently developing an application under the Ionic framework. 我目前正在Ionic框架下开发应用程序。 After trying to inject a function in a state in a .js file corresponding to a page of my application, I encountered a very strange problem. 在尝试将状态下的功能注入与应用程序页面相对应的.js文件后,我遇到了一个非常奇怪的问题。

My Ionic Serve refreshed and became blank and I had this message written when I tried a new Ionic Serve command : 我的离子服务刷新后变成空白,当我尝试新的离子服务命令时,我写下了此消息:

[WARN] Error with .\www\lib\ionic\version.json file: FILE_NOT_FOUND, trying .\bower.json.

I already checked the Internet, I deleted my node_modules folder and did npm install after. 我已经检查了Internet,删除了我的node_modules文件夹,然后安装了npm。 The warning has disappeared but Ionic Serve still gives me a blank page instead of my index.html. 该警告已消失,但Ionic Serve仍然给我一个空白页,而不是我的index.html。

Here is my 'ionic info' output : 这是我的“离子信息”输出:

$ ionic info
[WARN] Error with .\www\lib\ionic\version.json file: FILE_NOT_FOUND, trying 
.\bower.json.
[WARN] Error with .\www\lib\ionic\version.json file: FILE_NOT_FOUND, trying 
.\bower.json.

cli packages: (C:\Users\RAPH\AppData\Roaming\npm\node_modules)

@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0

global packages:

cordova (Cordova CLI) : 8.0.0
Gulp CLI              : CLI version 3.9.1 Local version 3.9.1

local packages:

Cordova Platforms : android 7.0.0
Ionic Framework   : ionic1 1.3.4

System:

Android SDK Tools : 26.1.1
Node              : v10.2.1
npm               : 5.6.0
OS                : Windows 7

Environment Variables:

ANDROID_HOME : C:\Users\RAPH\AppData\Local\Android\Sdk

Misc:

backend : pro

Please help me to resolve this problem, I need to finish my work for sunday. 请帮助我解决此问题,我需要在星期天完成我的工作。 I would be very grateful and if I can help you on something else don't hesitate to ask in return 我将不胜感激,如果我能在其他方面帮助您,请随时提出要求。

Is this how you're entire code block looks? 这就是整个代码块的外观吗?

var app = angular.module('app', ['ui.router']);
app.config(function($stateProvider, $urlRouterProvider) {
  $urlRouterProvider.otherwise("/index");
  $stateProvider
    .state("index", {
      url: "/index",
      templateUrl: "index.html"
    })
    .state("menu", {
      url: "/menu",
      templateUrl: "menu.html"
    })
    .state("indication_patient", {
      url: "/indication_patient",
      templateUrl: "indication_patient.html"
    })
    .state("competition", {
      url: "/competition",
      templateUrl: "competition.html"
    })
    .state("patient", {
      url: "/patient",
      templateUrl: "patient.html"
    })
    .state("athlete", {
      url: "/athlete",
      templateUrl: "athlete.html"
    });
});

try to download cors google chrome extension and install it in ur google chrome and re run the "ionic serve" command with the extension being turned on in google chrome 尝试下载cors google chrome扩展并将其安装在ur google chrome中,然后在google chrome中打开扩展名的情况下重新运行“ ionic serve”命令

here is the link : https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi?hl=en 这是链接: https : //chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi?hl=zh-CN

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM