18 Feb

Ionic | Troubleshooting

Custom Components

Use ion-* components in a custom component

Create the custom html file, for example with this content

<ion-grid no-padding no-margin class="custom-component">
  <ion-row class="star">
    <ion-col text-center *ngFor="let item of items">
      <button ion-button item-end outline icon-start (click)="itemSelected(item)">
        <ion-icon name='star'></ion-icon>{{ item }}
      </button>
    </ion-col>
  </ion-row>
</ion-grid>

Create a components.module.ts file and add this to the imports:

imports: [
  IonicModule
],

General Build Errors

How to fix TypeError: Cannot read property ‚Private‘ of undefined

$

How to fix TypeError: AppScripts.serve is not a function

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

How to fix Error: Cannot find module ‚@ionic/app-scripts‘

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

How to fix Error: Cannot find module ‚@angular/tsc-wrapped/src/tsc‘

$ npm install --save-dev @angular/tsc-wrapped@latest

How to fix Error: Cannot find module ‚@angular/compiler-cli‘

$ npm install --save-dev @angular/compiler-cli@latest

How to fix Error: Cannot read property ‚replace‘ of undefined

Read here for details

$ npm install ios-sim@latest

Or edit line 283 in file lib.js and follow https://github.com/phonegap/ios-sim/pull/213/files

vi platforms/ios/cordova/node_modules/ios-sim/src/lib.js

Change to

list.push(util.format('%s, %s', name_id_map[ filterDeviceName(devicename) ].replace(/^com.apple.CoreSimulator.SimDeviceType./, ''), runtime.replace(/^iOS /, '')));

How to fix Error: spawn EACCES

$ ionic hooks add

How to fix Cannot find variable WebpackJsonp

$

How to fix Class ‚Subject<T>‘ incorrectly extends base class ‚Observable<T>‘. Types of property ‚lift‘ are incompatible

Update your typescript module