Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cannot find module “@angular/core/src/metadata/directives”

I am getting this error when trying to view my Ionic2 application. I have tried to implement a weather application within my application. I am unsure if this is causing an error.

I am unsure where the error is coming from so I am unsure which code to post, so, please let me know if there is a certain part of code you need to see.

cannot find module “@angular/core/src/metadata/directives”

import { Component } from '@angular/core';
import { Platform } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import firebase from 'firebase';
import { firebaseConfig } from './credentials';
import { HomePage } from '../pages/home/home';
import { Unsubscribe } from '@firebase/util';
import {MenuPage} from '../pages/menu/menu';

@Component({
  templateUrl: 'app.html'
})
export class MyApp {
  rootPage: any;

  constructor(
    platform: Platform,
    statusBar: StatusBar,
    splashScreen: SplashScreen
  ) {
    firebase.initializeApp(firebaseConfig);

    const unsubscribe: Unsubscribe = firebase.auth().onAuthStateChanged(user => {
      if (user) {
        this.rootPage = HomePage;
        unsubscribe();
      } else {
        this.rootPage = 'LoginPage';
        unsubscribe();
      }
    });

    platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      statusBar.styleDefault();
      splashScreen.hide();
    });
  }
}
like image 506
UKbound Avatar asked Jan 21 '18 16:01

UKbound


1 Answers

Deep imports are not supported as i mentioned in the comment above, Change

From

import {Input} from '@angular/core/src/metadata/directives';

To

 import {Input} from '@angular/core';
like image 98
Sajeetharan Avatar answered Oct 02 '22 09:10

Sajeetharan