Ionic cli encountered mystery mistake


#1

below’s my code in the file that caused the error

import { Component, OnInit } from '@angular/core'
import { ToastController } from 'ionic-angular'

import { Subject } from 'rxjs/Subject'
import { Observable } from 'rxjs/Observable'
import 'rxjs/add/operator/debounceTime'
import 'rxjs/add/operator/distinctUntilChanged'
import 'rxjs/add/operator/switchMap'

import ApiService from '../../providers/api.service'

@Component({
  selector: 'page-my-playlists',
  templateUrl: './my-playlists.component.html'
})
export default class implements OnInit {

  uid = new Subject<string>()
  playlists: Observable<{}>

  constructor(
    private toastCtrl: ToastController,
    private apiService: ApiService) {

  }

  ngOnInit() {
    this.playlists = this.uid
      .debounceTime(300)
      .distinctUntilChanged()
      .switchMap((uid: string) => this.apiService.playlists(uid))
  }

  // private toastMessage(msg) {
  //   this.toastCtrl.create({
  //     message: msg,
  //     showCloseButton: true,
  //     closeButtonText: 'Close',
  //     position: 'bottom'
  //   }).present()
  // }

} 

when I run ionic serve:

but if I delete

@Component({
  selector: 'page-my-playlists',
  templateUrl: './my-playlists.component.html'
})

no errors will occur

hope my poor english can be understand


#2

when I run ionic info

global packages:

    @ionic/cli-plugin-proxy : 1.3.0
    @ionic/cli-utils        : 1.3.0
    Ionic CLI               : 3.3.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-ionic-angular : 1.3.0
    Ionic Framework                 : ionic-angular 3.3.0

System:

    Node       : v7.10.0
    OS         : macOS Sierra
    Xcode      : Xcode 8.3.2 Build version 8E2002
    ios-deploy : 1.9.1
    ios-sim    : 5.0.13