When I try to run npm run server
I get the error :
ERROR in Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function (position 64:19 in the original .ts file), resolving symbol AppModule in C:/Users/*****/src/app/app.module.ts
webpack: Failed to compile.
Here is the content of my app.module.ts :
import { NgModule, ApplicationRef } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import {SharedService} from './shared.service';
import { FormsModule } from '@angular/forms';
import {MaskedInput} from './+front/masked-input.directive';
/*
* Platform and Environment providers/directives/pipes
*/
import { routing } from './app.routing'
// App is our top level component
import { AppComponent } from './app.component';
import { APP_RESOLVER_PROVIDERS } from './app.resolver';
import { AppState, InternalStateType } from './app.service';
// Core providers
import {CoreModule} from "./core/core.module";
import {SmartadminLayoutModule} from "./shared/layout/layout.module";
import {UrlPermission} from "./UrlPermission/urlPermession";
import {Http, HttpModule, RequestOptions, XHRBackend} from '@angular/http';
import {MyCustomHttp} from './interceptor';
import {AuthService} from './AuthService/AuthService';
// Application wide providers
const APP_PROVIDERS = [
...APP_RESOLVER_PROVIDERS,
AppState
];
type StoreType = {
state: InternalStateType,
restoreInputValues: () => void,
disposeOldHosts: () => void
};
/**
* `AppModule` is the main entry point into Angular2's bootstraping process
*/
@NgModule({
bootstrap: [ AppComponent ],
declarations: [
AppComponent,
],
imports: [ // import Angular's modules
BrowserModule,
BrowserAnimationsModule,
FormsModule,
HttpModule,
CoreModule,
SmartadminLayoutModule,
routing
],
exports: [
],
providers: [ // expose our Services and Providers into Angular's dependency injection
// ENV_PROVIDERS,
APP_PROVIDERS,
SharedService,
UrlPermission,
AuthService,
MaskedInput,
{
provide: Http,
useFactory: (backend,options) => new MyCustomHttp(backend, options),
deps: [XHRBackend, RequestOptions]
},
]
})
export class AppModule {
constructor(public appRef: ApplicationRef, public appState: AppState) {}
}
I thought it was a node version problem so I downgraded NodeJS from 10 version to 8 version. But the error is always the same It worked fine on my old computer. I don't know what changes or what commands should I tape. or how should I change the app.module.ts
Any help please? Thank you