question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AOT compilation error

See original GitHub issue

Hello, I am using v.1.3.0 with Angular 7 and works fine with a simple ng-serve, but when I build the application with ng-build and AOT enabled, it fails with the following error:

ERROR in Error during template compile of 'AppModule'
  Function calls are not supported in decorators but 'weekdaysMin' was called in 'ɵb'
    'ɵb' calls 'weekdaysMin' at ../ngx-daterangepicker-material/ngx-daterangepicker-material.ts(24,17).

I import the picker module in my app module with NgxDaterangepickerMd.forRoot().

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:16 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
adapptadmincommented, Jan 21, 2019

above issues i got solution localconfi: any = { applyLabel: 'ok',separator: ' To ', format: 'ddd, MMMM D, YYYY h:mm A', direction: 'ltr', weekLabel: 'W', cancelLabel: 'Cancel', customRangeLabel: 'Custom range', daysOfWeek: moment.weekdaysMin(), monthNames: moment.monthsShort(), firstDay: moment.localeData().firstDayOfWeek() };

<input matInput type="text" ngxDaterangepickerMd [(ngModel)]="selected" (ngModelChange)="datepickerChange($event)" [alwaysShowCalendars]="true" [ranges]="ranges" [showClearButton]="true" [locale]="localconfi" placeholder="Double Click for Date" class="form-control" required/> </mat-form-field> NgxDaterangepickerMd.forRoot({ separator: ' To ', applyLabel: 'Okay', format: 'ddd, MMMM D, YYYY h:mm A' })

2reactions
lmbaicommented, Jan 24, 2019

@ashokvarmauppalapati hi , can u check your package.json?

If you a using ^1.2.7. And run npm install —force accidentally, it may reinstall the 1.3.0.

Just a gentle reminder, I made the same mistake a few days ago. Better fix the version to 1.2.7

Read more comments on GitHub >

github_iconTop Results From Across the Web

angular - Why won't aot compiler error on missing property?
AoT compiles the template beforehand, and is looking for the bindings to be generated. On the other hand, having it in an ng-container...
Read more >
Ahead-of-time (AOT) compilation - Angular
Errors in AOT compilation commonly occur because of metadata that does not conform to the compiler's requirements (as described more fully below).
Read more >
Angular 6 AOT compilation not working - Error in ... - GitHub
I created minimal sample app to reproduce this error. The key point is that this app is AOT compiled using the webpack plugin...
Read more >
Improved Error Logging by the Angular AOT Compiler
When this component is sent to the compiler, this component compilation already failed and the compiler is not taking it as a valid...
Read more >
Angular: Writing AoT-friendly applications | by David - Medium
However, with AoT compilation ( ng build --prod ), we encounter several errors. We will talk through this errors and look how to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found