Skip to content

一、服务运行相关

1. 模块缺失
1. Cannot find module '@angular/http's
npm install @angular/http@latest
2. 定义文件缺失
1. Cannot find type definition file for '@types'.
 npm i @ionic/app-scripts@3.2.3
2. Argument of type '{ declarations: (typeof HomePage | typeof MyApp)[]; imports:
Argument of type '{ declarations: (typeof HomePage | typeof MyApp)[]; imports: (ModuleWithProviders | typeof
Browse...' is not assignable to parameter of type 'NgModule'. Types of property 'providers' are
incompatible. Type '(typeof SplashScreen | PushOriginal | { provide: typeof ErrorHandler; useClass: typeof
IonicError...' is not assignable to type 'Provider[]'. Type 'typeof SplashScreen | PushOriginal | { provide:
typeof ErrorHandler; useClass: typeof IonicErrorH...' is not assignable to type 'Provider'. Type
'PushOriginal' is not assignable to type 'Provider'. Type 'PushOriginal' is not assignable to type
'ClassProvider'. Property 'provide' is missing in type 'PushOriginal'

原因:插件安装存在问题 解决方案:移除相应的插件,再次进行安装,如果还不行,去仓库搜寻合适的版本插件,再次安装。直到不报错为止。

3. 运行内存相关
1. JavaScript heap out of memory

image-20200830194447120

# 1.安装increase-memory-limit插件
npm install -g increase-memory-limit
# 2.再执行:increase-memory-limit
4. APP运行相关
1. ionic App 启动时报Application Error - The connection to the server was unsuccessful

最近在更新App的时候,发现在华为手机上报这个错误,有点困惑,查找资料分析,大概原因是程序在加载index.html网页时,加载的资源过多,造成时间超时。

解决方案:

xml
 <!--解决程序启动问题:Application Error - The connection to the server was unsuccessful-->
  <preference name="loadUrlTimeoutValue" value="700000" />

Released under the MIT License.