search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Error while compiling angular2 project using AOT compiler " StaticSymbols in summaries can't have members!".

Asked by Anonymous
7 years ago.

Does anyone get this error while compiling the angular2 project with the DayPilot Scheduler using AOT compiler?

Error: Internal state: StaticSymbols in summaries can't have members! {"filePath":"/Users/maneeshmadan/projects/kairosUI/src/app/shared/shared.module.ts","name":"DayPilot","members":["Angular","Scheduler"]}
at AotSummaryResolver._assertNoMembers (/Users/maneeshmadan/projects/kairosUI/node_modules/@angular/compiler/bundles/compiler.umd.js:26300:23)
at AotSummaryResolver.resolveSummary (/Users/maneeshmadan/projects/kairosUI/node_modules/@angular/compiler/bundles/compiler.umd.js:26308:18)
at CompileMetadataResolver._loadSummary (/Users/maneeshmadan/projects/kairosUI/node_modules/@angular/compiler/bundles/compiler.umd.js:18032:70)
at CompileMetadataResolver.getNgModuleSummary (/Users/maneeshmadan/projects/kairosUI/node_modules/@angular/compiler/bundles/compiler.umd.js:18226:56)
at /Users/maneeshmadan/projects/kairosUI/node_modules/@angular/compiler/bundles/compiler.umd.js:18318:72
at Array.forEach (native)
at CompileMetadataResolver.getNgModuleMetadata (/Users/maneeshmadan/projects/kairosUI/node_modules/@angular/compiler/bundles/compiler.umd.js:18313:53)
at addNgModule (/Users/maneeshmadan/projects/kairosUI/node_modules/@angular/compiler/bundles/compiler.umd.js:25053:62)
at /Users/maneeshmadan/projects/kairosUI/node_modules/@angular/compiler/bundles/compiler.umd.js:25064:18
at Array.forEach (native)
Extraction failed

Please let me know.
Thanks

Comment posted by Dan Letecky [DayPilot]
7 years ago.

AOT is not yet supported. It's in the works, stay tuned.

Comment posted by Arvind
7 years ago.

Any Ideas when can I expect it ? My application has become much slower after implementing translations and I see aot is the solution right now . Any expected dates ?

Thanks a Lot!

Comment posted by Dan Letecky [DayPilot]
7 years ago.

It will take at least a couple of weeks - it's not a trivial thing.

Comment posted by Arvind
7 years ago.

Alright! Thanks for the update. I will have to find an alternative till then. :)

Comment posted by Tahir Awan
7 years ago.

any update?

Comment posted by Arvind
7 years ago.

any updates team ?

Comment posted by Dan Letecky [DayPilot]
7 years ago.

Please hold on - all updates will be posted here.

Answer posted by Dan Letecky [DayPilot]
7 years ago.

The latest sandbox build (8.3.2769) now supports AOT.

The Angular 2 components were moved out of the DayPilot.Angular namespace and it's necessary to use the new component names. The old components in the DayPilot.Angular namespace are still supported but they will be deprecated and eventually removed. The old components are not compatible with AOT.

Old syntax (scheduler.module.ts from https://code.daypilot.org/25443/angular-2-scheduler-read-only-and-edit-mode-switching):

import {DataService} from "./data.service";
import {HttpModule} from "@angular/http";
import {FormsModule} from "@angular/forms";
import {BrowserModule} from "@angular/platform-browser";
import {NgModule} from "@angular/core";
import {SchedulerComponent} from "./scheduler.component";
import {DayPilot} from "daypilot-pro-angular";

@NgModule({
  imports:      [ 
    BrowserModule, 
    FormsModule, 
    HttpModule 
  ],
  declarations: [
    DayPilot.Angular.Scheduler,
    SchedulerComponent
  ],
  exports:      [ SchedulerComponent ],
  providers:    [ DataService ]
})
export class SchedulerModule { }

Note that the Angular 2 Scheduler component from DayPilot Pro package is in the "declarations" section (DayPilot.Angular.Scheduler).

New syntax:

import {DataService} from "./data.service";
import {HttpModule} from "@angular/http";
import {FormsModule} from "@angular/forms";
import {BrowserModule} from "@angular/platform-browser";
import {NgModule} from "@angular/core";
import {SchedulerComponent} from "./scheduler.component";
import {DayPilotModule} from "daypilot-pro-angular";

@NgModule({
  imports:      [ 
    BrowserModule, 
    FormsModule, 
    HttpModule, 
    DayPilotModule 
  ],
  declarations: [
    SchedulerComponent
  ],
  exports:      [ SchedulerComponent ],
  providers:    [ DataService ]
})
export class SchedulerModule { }

Note that individual declarations (such as DayPilot.Angular.Scheduler) are replaced by importing DayPilotModule ("imports" section). This automatically makes all DayPilot components available in component templates.

The following components are available:

* DayPilotSchedulerComponent (previously DayPilot.Angular.Scheduler)
* DayPilotCalendarComponent (previously DayPilot.Angular.Calendar)
* DayPilotMonthComponent (previously DayPilot.Angular.Month)
* DayPilotNavigatorComponent (previously DayPilot.Angular.Navigator)
* DayPilotGanttComponent (previously DayPilot.Angular.Gantt)
* DayPilotKanbanComponent (previously DayPilot.Angular.Kanban)
* DayPilotModalComponent (previously DayPilot.Angular.Modal)

Comment posted by Arvind
7 years ago.

Thanks a LOT ! I will give it a try right away :)

Comment posted by Arvind
7 years ago.

currently getting this error :
ERROR in [at-loader] ./node_modules/daypilot-pro-angular/daypilot-angular.min.d.ts:8:10
TS2440: Import declaration conflicts with local declaration of 'DayPilot'

Comment posted by Dan Letecky [DayPilot]
7 years ago.

It looks like you might be declaring "DayPilot" somewhere in your code.

Anyway, there is a sample project available for download that uses the new syntax and is compatible with AOT. You can download it here:

https://code.daypilot.org/47032/angular-2-scheduler-ahead-of-time-aot-compilation

It's pretty simple - there is just one component (scheduler.component.ts) that uses DayPilot Scheduler.

The tutorial is built using the latest Angular CLI version (RC2).

Let me know if there is any problem.

Comment posted by Arvind
7 years ago.

Alright! Will check it out and the possible past imports. Thanks!

Comment posted by Arvind
7 years ago.

How to get guid and "today()" instances like we had with Daypilot ?

Comment posted by Dan Letecky [DayPilot]
7 years ago.

You can use the DayPilot namespace as before. Just don't use Angular 2 components from DayPilot.Angular.*.

Modified example (scheduler.component.ts from https://code.daypilot.org/47032/angular-2-scheduler-ahead-of-time-aot-compilation) that uses DayPilot.Date class:

import {Component, ViewChild, AfterViewInit} from "@angular/core";
import {DayPilot, DayPilotSchedulerComponent} from "daypilot-pro-angular";
import {DataService} from "./data.service";{}

@Component({
  selector: 'scheduler-component',
  template: `
  <div>Today: {{today}}</div>
  <daypilot-scheduler [config]="config" [events]="events" #scheduler></daypilot-scheduler>`,
  styles: [``]
})
export class SchedulerComponent implements AfterViewInit {

  @ViewChild("scheduler")
  scheduler: DayPilotSchedulerComponent;

  events: any[] = [];

  today: DayPilot.Date;

  config: any = {
    timeHeaders : [
      {groupBy: "Month", format: "MMMM yyyy"},
      {groupBy: "Day", format: "d"}
    ],
    eventHeight: 40,
    scale: "Day",
    days: 31,
    startDate: "2017-01-01",
  };

  constructor(private ds: DataService) {
    this.today = DayPilot.Date.today();
  }

  ngAfterViewInit(): void {
    this.ds.getResources().subscribe(result => this.config.resources = result);

    var from = this.scheduler.control.visibleStart();
    var to = this.scheduler.control.visibleEnd();
    this.ds.getEvents(from, to).subscribe(result => {
      this.events = result;
    });
  }

}
Comment posted by Arvind
7 years ago.

Ok, Somehow I spent much time on the error I got above, problem is still same, In my whole code , nowhere i am importing DayPilot.Angular.Schedular or any other components like this, but error is same :
`
ERROR in [at-loader] ./node_modules/daypilot-pro-angular/daypilot-angular.min.d.ts:8:10
TS2440: Import declaration conflicts with local declaration of 'DayPilot'
`
Not sure how to debug it more.

Comment posted by Dan Letecky [DayPilot]
7 years ago.

Can you try to upgrade to the latest DayPilot Pro build? It's possible that you are using one of the interim sandbox builds that don't work properly:

npm install https://npm.daypilot.org/daypilot-pro-angular/trial/8.3.2784.tar.gz --save

Let me know if it didn't help.

Comment posted by Arvind
7 years ago.

I have been refreshing this page for minutes . Yes, this new one compiles without a problem, hopefully now I will be able to continue. problem was with sandbox build.

THANKS!

Comment posted by MT
7 years ago.

When will this be available in licensed version ?

Comment posted by Dan Letecky [DayPilot]
7 years ago.

An official release with AOT support is now available:

https://javascript.daypilot.org/daypilot-pro-for-javascript-8-3-sp12/

Comment posted by Avilash
7 years ago.

As given in the above link, i have followed the same steps:
1. Replace import of individual components (DayPilot.Angular.* namespace) in "declarations" section of
@NgModule with import of DayPilotModule.
2. Replace references to DayPilot.Angular.* component classes with new classes (DayPilot*Component).

and when i compiled the my application for aot, I got below error.

Template parse errors:
'ng-template' is not a known element:
1. If 'ng-template' is an Angular component, then verify that it is part of this module.
2. If 'ng-template' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. ("
[@slide]="visibility"
>
[ERROR ->]<ng-template #placeholder></ng-template>
<ng

  • content></ng-content>
  • </div>

"): DayPilotModalComponent@10:4

Please help me with this.

Comment posted by Dan Letecky [DayPilot]
7 years ago.

There are some conflicting requirements in Angular 2.x and Angular 4.x. This means the AOT-compatible components are now only compatible with Angular 4 (<template> has been changed to <ng-template> in Angular 4).

I recommend switching to Angular 4 (it's required by Angular CLI 1.0 anyway).

We're working on maintaining the compatibility with Angular 2.x. It looks like it will be possible but DayPilotModalComponent will have to be moved to a standalone package.

Comment posted by Dan Letecky [DayPilot]
7 years ago.

Update:

The DayPilotModalComponent has been rewritten and it's now compatible with both Angular 2.x and Angular 4 (AOT compilation is supported for both versions).

It's now available in the sandbox (https://javascript.daypilot.org/sandbox/) and at https://npm.daypilot.org as version 8.3.2826.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.