简体   繁体   中英

Runtime Error: Cannot find module “./config”

Hi Guys i'm trying to make changes on an Ionic 3 App, i have downgraded my node and ran npm install but i keep getting this error on my browser any time i run ionic serve. Please Help

Runtime Error: Cannot find module "./config"

Stack

Error: Cannot find module "./config"

at Object.<anonymous> (http://localhost:8100/build/main.js:95985:7)
at __webpack_require__ (http://localhost:8100/build/main.js:48:30)
at Object.<anonymous> (http://localhost:8100/build/main.js:139326:70)
at __webpack_require__ (http://localhost:8100/build/main.js:48:30)
at http://localhost:8100/build/main.js:140:18
at http://localhost:8100/build/main.js:143:10

App.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule } from '@angular/core';
import { FormsModule } from "@angular/forms";
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { IonicStorageModule } from '@ionic/storage';
import { HttpModule } from "@angular/http";

import { MyApp } from './app.component';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';

import { StorageService } from "../providers/storage";
import { Auth } from "../providers/auth";
import { Api } from "../providers/api";
import { DatabaseService } from "../providers/database";

import { AngularFireModule } from "angularfire2";
import { AngularFireAuthModule } from 'angularfire2/auth';
import { AngularFireDatabaseModule } from 'angularfire2/database';
import { firebaseConfig } from './config';
import { ValidateProvider } from '../providers/validate/validate';

@NgModule({
  declarations: [
    MyApp,
  ],
  imports: [
    BrowserModule,
    HttpModule,
    FormsModule,
    IonicStorageModule.forRoot(),
    AngularFireModule.initializeApp(firebaseConfig),
    AngularFireDatabaseModule,
    AngularFireAuthModule,
    IonicModule.forRoot(MyApp)
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp
  ],
  providers: [
    StatusBar,
    SplashScreen,
    StorageService,
    DatabaseService,
    Auth,
    Api,
    {provide: ErrorHandler, useClass: IonicErrorHandler},
    ValidateProvider
  ]
})
export class AppModule {}

I'm still new to this, and i know a'm just missing something please help out. Thanks

in your app.module.ts remove import { firebaseConfig } from './config'; or try to remove firebase and install it again : npm plugin remove

只需确保Firebase配置已正确链接到app.module.ts谢谢

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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