我想在产品中构建我的应用,但出现错误:
Unexpected value 'null' imported by the module 'AppModule in /src/app/app.module.ts'
我做了一些研究,我认为错误是由于我导入了一种本身就是export default statement ....
问题在于它可能是一个本机模块,我无法更改它。是否可以禁用或忽略此错误,以便我可以完成构建?
我的模块:
export function createTranslateLoader(http: HttpClient) {
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}
@NgModule({
declarations: [
MyApp,
HomePage,
LoginPage,
RegisterPage,
StationsPage,
LogoutPage,
MapsPage,
ItineraryPage,
RecordingPage,
DatePipeProxy
],
imports: [
BrowserModule,
BrowserAnimationsModule,
IonicStepperModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: (createTranslateLoader),
deps: [HttpClient]
}
}),
IonicModule.forRoot(MyApp, {
backButtonText: '',
iconMode: 'ios',
modalEnter: 'modal-slide-in',
modalLeave: 'modal-slide-out',
tabbarPlacement: 'bottom',
pageTransition: 'ios',
}),
ReactiveFormsModule,
HttpClientModule
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage,
LoginPage,
RegisterPage,
StationsPage,
LogoutPage,
MapsPage,
ItineraryPage,
RecordingPage
],
providers: [
StatusBar,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler},
AuthProvider,
StationProvider,
MeteoProvider,
{ provide: LOCALE_ID, useValue: 'fr-FR' },
NetworkProvider,
Facebook,
MapsProvider,
Astar,
Geolocation,
File,
ConnexionProvider,
Network,
CacheFile,
LanguageProvider,
{ provide: LOCALE_ID, useValue: window.navigator.language },
BatchProvider
]
})
export class AppModule {}