title: why Reference to a local (non-exported) symbol 'require' error is giving?
body: <p>I tried many solutions from here but still its showing this error </p>
  
  <blockquote>
    <p>ERROR in Error encountered resolving symbol values statically.
    Reference to a local (non-exported) symbol 'require'. Consider
    exporting the symbol (position 8:13 in the original .ts file),
    resolving symbol AppModule in
    C:/Users/Bristy/Documents/realtime_chart/client/src/app/app.module.ts</p>
    
    <p>npm ERR! code ELIFECYCLE</p>
    
    <p>npm ERR! errno 1</p>
    
    <p>npm ERR! live-chart@0.0.0 build: <code>ng build</code></p>
    
    <p>npm ERR! Exit status 1</p>
    
    <p>npm ERR! </p>
    
    <p>npm ERR! Failed at the live-chart@0.0.0 build script.</p>
    
    <p>npm ERR! This is probably not a problem with npm. There is likely
    additional logging output above.</p>
    
    <p>npm ERR! A complete log of this run can be found in:</p>
    
    <p>npm ERR!<br>
    C:\Users\Bristy\AppData\Roaming\npm-cache_logs\2018-05-09T17_11_42_862Z-debug.log
    Done.</p>
  </blockquote>
  
  <p>Here is my app.module.ts</p>
  
  <pre><code>import { BrowserModule } from '@angular/platform-browser';
  
  import { NgModule } from '@angular/core';
  
  import { FormsModule } from '@angular/forms';
  
  import { HttpModule } from '@angular/http';
  
  import { AppComponent } from './app.component';
  
  import { ChartModule } from 'angular2-highcharts/index';
  
  import { HighchartsStatic } from 'angular2-highcharts/dist/HighchartsService';
  
  declare var require: any;
  
  
  
   export function highchartsFactory() {
  
        const hc = require('highcharts');
  
        const dd = require('highcharts/modules/drilldown');
  
        dd(hc);
  
  
        return hc;
  
      }
  
  
  @NgModule({
  
    declarations: [
  
      AppComponent
  
    ],
  
    imports: [
  
      BrowserModule,
  
      FormsModule,
  
      HttpModule,
  
      ChartModule.forRoot(require('highcharts/highstock')),
  
    ],
  
    providers: [ {
  
            provide: HighchartsStatic,
  
            useFactory: highchartsFactory
  
          }],
  
    bootstrap: [AppComponent]
  
  })
  
  export class AppModule { }
  </code></pre>