angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Need more detailed info about error stack trace

Open mateuszwitkowski opened this issue 9 years ago • 7 comments

OS?

Windows 10

Versions.

angular-cli: 1.0.0-beta.24
node: 6.3.1
os: win32 x64
@angular/common: 2.4.1
@angular/compiler: 2.4.1
@angular/core: 2.4.1
@angular/forms: 2.4.1
@angular/http: 2.4.1
@angular/material: 2.0.0-beta.1
@angular/platform-browser: 2.4.1
@angular/platform-browser-dynamic: 2.4.1
@angular/platform-server: 2.4.1
@angular/router: 3.4.1
@angular/compiler-cli: 2.4.1

Repro steps.

App was developed usin Webpack. Recently switched to Angular-CLI. It's working ok while using ng serve but error occurred when trying to build AOT version (ng build --aot). Error message ('ERROR in Cannot read...") isn't very helpful because I have no idea which file / part of code caused problem.

The log given by the failure.

chunk    {0} scripts.bundle.js, scripts.bundle.map (scripts) 121 kB {3} [initial] [rendered]
chunk    {1} main.bundle.js, main.bundle.map (main) 1.06 kB {2} [initial] [rendered]
chunk    {2} vendor.bundle.js, vendor.bundle.map (vendor) 1.18 MB [initial] [rendered]
chunk    {3} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry] [rendered]

ERROR in Cannot read property 'length' of undefined

ERROR in ./app/main.ts
Module not found: Error: Can't resolve './$$_gendir/app.module.ngfactory' in 'C:\frontend-angular-cli\app'
 @ ./app/main.ts 8:0-70
 @ multi main

ERROR in ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js
Module not found: Error: Can't resolve 'C:\frontend-angular-cli\app\$$_gendir' in 'C:\frontend-angular-cli\node_modules\@angular\core\src\linker'
@ ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js 69:15-36 85:15-102
@ ./~/@angular/core/src/linker.js
@ ./~/@angular/core/src/core.js
@ ./~/@angular/core/index.js
@ ./app/main.ts
@ multi main

Mention any other details that might be useful.

tsconfig.json

{
  "compilerOptions": {
    "baseUrl": "",
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": ["es6", "dom"],
    "mapRoot": "./",
    "module": "es6",
    "moduleResolution": "node",
    "outDir": "dist",
    "sourceMap": true,
    "target": "es5",
    "typeRoots": [
      "../node_modules/@types"
    ]
  }
}

angular-cli.json

{
  "project": {
    "version": "1.0.0-beta.24",
    "name": "frontent-angular-clo"
  },
  "apps": [
    {
      "root": "app",
      "outDir": "dist",
      "assets": [
        "assets",
        "favicon.ico"
      ],
      "index": "index.html",
      "main": "main.ts",
      "test": "test.ts",
      "tsconfig": "tsconfig.json",
      "prefix": "app",
      "mobile": false,
      "styles": [
      ],
      "scripts": [
        "./assets/bower_components/webcomponentsjs/webcomponents.min.js"
      ],
      "environments": {
        "source": "environments/environment.ts",
        "dev": "environments/environment.ts",
        "prod": "environments/environment.prod.ts"
      }
    }
  ],
  "addons": [
  ],
  "packages": [
  ],
  "e2e": {
    "protractor": {
      "config": "./protractor.conf.js"
    }
  },
  "test": {
    "karma": {
      "config": "./karma.conf.js"
    }
  },
  "defaults": {
    "styleExt": "scss",
    "prefixInterfaces": false,
    "inline": {
      "style": false,
      "template": false
    },
    "spec": {
      "class": false,
      "component": true,
      "directive": true,
      "module": false,
      "pipe": true,
      "service": true
    }
  }
}

package.json

{
  "name": "adar-frontend",
  "version": "1.0.0",
  "angular-cli": {},
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "lint": "tslint \"app/**/*.ts\"",
    "test": "ng test",
    "pree2e": "webdriver-manager update --standalone false --gecko false",
    "e2e": "protractor",
    "typings": "typings install --global",
    "postinstall": "typings install"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "2.4.1",
    "@angular/compiler": "2.4.1",
    "@angular/core": "2.4.1",
    "@angular/forms": "2.4.1",
    "@angular/http": "2.4.1",
    "@angular/material": "2.0.0-beta.1",
    "@angular/platform-browser": "2.4.1",
    "@angular/platform-browser-dynamic": "2.4.1",
    "@angular/platform-server": "2.4.1",
    "@angular/router": "3.4.1",
    "@types/lodash": "^4.14.45",
    "@types/socket.io-client": "1.4.29",
    "@vaadin/angular2-polymer": "1.0.0-rc3",
    "angular2-infinite-scroll": "0.2.8",
    "angular2-moment": "1.0.0",
    "core-js": "^2.4.1",
    "hammerjs": "2.0.8",
    "lodash": "4.17.4",
    "ng2-charts": "1.4.4",
    "ng2-dnd": "2.1.1",
    "ng2-pdf-viewer": "0.1.5",
    "rxjs": "5.0.2",
    "ts-helpers": "^1.1.2",
    "zone.js": "0.7.4"
  },
  "devDependencies": {
    "@angular/compiler-cli": "^2.4.1",
    "@types/jasmine": "2.5.40",
    "@types/node": "^6.0.57",
    "angular-cli": "1.0.0-beta.24",
    "codelyzer": "~2.0.0-beta.4",
    "jasmine-core": "2.5.2",
    "jasmine-spec-reporter": "3.0.0",
    "karma": "1.3.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-jasmine": "^1.1.0",
    "karma-remap-istanbul": "^0.4.0",
    "protractor": "~4.0.14",
    "ts-node": "2.0.0",
    "tslint": "^4.2.0",
    "typescript": "2.0.10"
  }
}

mateuszwitkowski avatar Jan 09 '17 09:01 mateuszwitkowski

Seems like a dup of #3674

I'd recommend you take a look on that issue as a couple of members have posted possible fixes for this issue.

RicardoVaranda avatar Jan 09 '17 10:01 RicardoVaranda

I've read it earlier because actually at first I've got the error mentioned there ('ERROR in Error encountered resolving symbol values statically...'). I've handled it using tips from that issue but now I have new kind of error. Also, the error I'm getting now is quite different and not mentioned in any of issues here.

mateuszwitkowski avatar Jan 09 '17 10:01 mateuszwitkowski

Would you mind also posting your ngModule imports.

RicardoVaranda avatar Jan 09 '17 10:01 RicardoVaranda

Here it is. It's not divided into sub-modules so it's quite long.

@NgModule({
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    RouterModule,
    CommonModule,
    routing,
    MaterialModule.forRoot(),
    ChartsModule,
    DndModule,
    InfiniteScrollModule,
    MomentModule
  ],
  declarations: [
    SingleFreightMapComponent,
    ClientAllFreightsListComponent,
    ClientLastFreightsListComponent,
    LastFreightsListComponent,
    BoardClientComponent,
    ClientsListComponent,
    SetCardComponent,
    FleetSetCardComponent,
    ClientRatingComponent,
    AppComponent,
    AuthLoginComponent,
    AuthLogoutComponent,
    LayoutComponent,
    HomeComponent,
    HomeTrendChartComponent,
    HeaderBreadcrumbsComponent,
    HeaderSubmenuComponent,
    SettingsDatabaseComponent,
    SettingsPermissionsComponent,
    DataGridComponent,
    RcpComponent,
    CoordinatorsSetsComponent,
    CoordinatorsTasksComponent,
    SetDriverComponent,
    CurrentSetFreightComponent,
    FreightHistoryDialogComponent,
    SmsCategoryComponent,
    TaskMasterComponent,
    TaskFillingMainComponent,
    SmsCardComponent,
    SmsChangeLocationComponent,
    SmsDailyReportComponent,
    SmsGpsDialogComponent,
    SmsGpsSendComponent,
    SmsGpsTableComponent,
    SmsMilestoneComponent,
    SmsProblemComponent,
    TaskFillingPrimaryComponent,
    TaskFillingVerifyMapComponent,
    TaskFreightStepComponent,
    TaskInformMailComponent,
    TaskInformPhoneComponent,
    TaskInitialDirectionComponent,
    TaskRateDriverComponent,
    TaskSendOrderComponent,
    TaskFillingStampComponent,
    EditFreightMilestonesComponent,
    FreightStepComponent,
    LocationChooseComponent,
    MapsComponent,
    RadioMilestoneComponent,
    RateTheDriverComponent,
    SmsSendComponent,
    StarRateComponent,
    UserNamePipe,
    CurrencyValuePipe,
    SearchPipe,
    DistanceKmPipe,
    // DateFormatPipe,
    SearchInArrayPipe,
    MapToIterablePipe,
    SetsFormatPipe,
    Resizable,
    SmsViewComponent,
    CompanyEmployeesComponent,
    RecruitmentBoardComponent,
    RecruitmentNewComponent,
    RecruitmentPositionsComponent,
    RecruitmentPositionsNewComponent,
    RecruitmentDetailsComponent,
    StagesComponent,
    StagesNewComponent,
    CandidateComponent,
    CandidateApplicationComponent,
    CandidateGroupComponent,
    CandidateTalkComponent,
    CandidateTaskComponent,
    TalentBankComponent,
    EmailEditorComponent,
    EditDialogComponent,
    MeetingScheduleComponent,
    DecisionButtonsComponent,
    ListDialogComponent,
    VoipNumberSanitizePipe,
    InitialsPipe,
    // CalendarPipe,
    SearchPipe,
    NumberToArrayPipe,
    ChangeTypePipe,
    StatusToColorPipe,
    NullToStringPipe,
    // PolymerElement('vaadin-date-picker'),
    // PdfViewerComponent,
    ChipComponent,
    DatePicker,
    StepCircle,
    StageDialog,
    UserAvatarComponent,
    LoadingIndicatorComponent,
    FleetComponent,
    ArchivedApplicationsComponent,
    ForLaterComponent,
    ErrorDialog,
    LoadingIndicatorComponent,
    AutoCompleteComponent,
    AmsComponent,
    FreightValuationComponent,
    ValuationItemComponent,
    SpeditorMapComponent,
    CooperationItemComponent,
    SetInformationComponent,
    SetDetailsComponent,
    FreightStepChooseComponent,
    CurrentFreightComponent,
    SetListComponent,
    EmailFishingComponent,
    MarkAsStornoDialogComponent,
    AddFilesDialogComponent,
    SellLoadDialogComponent,
    SetSignListComponent,
    EmailSendAmsComponent,
    LoadInformationComponent,
    StatisticInformationComponent,
    FileViewDialogComponent,
    UserProfileComponent,
    CandidateDeleteConfirmationDialogComponent,
    RejectCandidateDialogComponent,
    CustomCandidateComponent,
    OtherComponent,
    OtherEnvelopesPrintComponent,
    OtherEnvelopesArchiveComponent,
    AddCompanyDialogComponent,
    DeleteApplicationDialogComponent,
    FreightComponent,
    HaulierComponent,
    HauliersComponent,
    LastFreightsListComponent,
    SetCardComponent,
    HrFilesDialogComponent,
    RecruitmentEmailsComponent
  ],
  providers: [
    MdIconRegistry,
    OVERLAY_PROVIDERS,
    MdUniqueSelectionDispatcher,
    appRoutingProviders,
    HttpService,
    ProtectComponentService,
    AuthService,
    Configuration,
    BoardResolver,
    BoardService,
    RecruitmentEndService,
    RecruitmentPositionDataService,
    StorageService,
    ErrorHandlerService,
    LOGGING_ERROR_HANDLER_PROVIDERS,
    AmsService,
    AmsStorageService
  ],
  entryComponents: [
    AppComponent,
    AuthLoginComponent,
    ErrorDialog,
    CandidateDeleteConfirmationDialogComponent,
    RejectCandidateDialogComponent,
    FreightHistoryDialogComponent,
    AddCompanyDialogComponent,
    DeleteApplicationDialogComponent,
    MarkAsStornoDialogComponent,
    AddFilesDialogComponent,
    FileViewDialogComponent,
    SellLoadDialogComponent,
    HrFilesDialogComponent
  ],
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
  bootstrap: [AppComponent]
})

export class AppModule {
}

mateuszwitkowski avatar Jan 09 '17 10:01 mateuszwitkowski

@hansl any idea what caused this?

filipesilva avatar Jan 24 '17 15:01 filipesilva

Thanks for reporting this issue. This issue is now obsolete due to changes in the recent releases. Please update to the most recent Angular CLI version.

If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.

filipesilva avatar May 22 '17 15:05 filipesilva

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.