Closed
Description
Bug Report or Feature Request (mark with an x
)
- [x] bug report
- [ ] feature request
Versions.
@angular/cli: 1.2.6
node: 6.11.1
os: win32 x64
@angular/animations: 4.3.3
@angular/common: 4.3.3
@angular/compiler: 4.3.3
@angular/core: 4.3.3
@angular/forms: 4.3.3
@angular/http: 4.3.3
@angular/platform-browser: 4.3.3
@angular/platform-browser-dynamic: 4.3.3
@angular/router: 4.3.3
@angular/cli: 1.2.6
@angular/compiler-cli: 4.3.3
@angular/language-service: 4.3.3
Repro steps.
Create a node module locally and link it with npm link
.
Go to your project generated with @angular/cli and link this module: npm link ngx-my-module
.
Use your module in your project. For instance:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { MyModule } from 'ngx-my-module';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AnalyticsModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Then run ng serve
The log given by the failure.
λ ng serve
Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
at createSourceFile (my-module\node_modules\typescript\lib\typescript.js:15457:109)
at parseSourceFileWorker (my-module\node_modules\typescript\lib\typescript.js:15389:26)
at Object.parseSourceFile (my-module\node_modules\typescript\lib\typescript.js:15338:26)
at Object.createSourceFile (my-module\node_modules\typescript\lib\typescript.js:15192:29)
at WebpackCompilerHost.getSourceFile (my-module\node_modules\@ngtools\webpack\src\compiler_host.js:239:27)
at findSourceFile (my-module\node_modules\typescript\lib\typescript.js:67909:29)
at processSourceFile (my-module\node_modules\typescript\lib\typescript.js:67840:27)
at my-module\node_modules\typescript\lib\typescript.js:67950:17
at Object.forEach (my-module\node_modules\typescript\lib\typescript.js:1449:30)
at processReferencedFiles (my-module\node_modules\typescript\lib\typescript.js:67948:16)
at findSourceFile (my-module\node_modules\typescript\lib\typescript.js:67933:21)
at processImportedModules (my-module\node_modules\typescript\lib\typescript.js:68056:25)
at findSourceFile (my-module\node_modules\typescript\lib\typescript.js:67937:17)
at processImportedModules (my-module\node_modules\typescript\lib\typescript.js:68056:25)
at findSourceFile (my-module\node_modules\typescript\lib\typescript.js:67937:17)
at processImportedModules (my-module\node_modules\typescript\lib\typescript.js:68056:25)
Mention any other details that might be useful.
I used generator-ngx-library to generate my node module project. It uses @angular/cli in a demo app.