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

Angular 6 error

Asked by Martin Säfsten
5 years ago.

Hey!

I'm currently experimenting with the migration from Angular 5 to Angular 6.

I am getting a runtime error in daypilot-angular.min.js. I've attached the image of the chrome console.

This error occurs when I'm navigating to my site's login screen, so this happens even before I've started my component containing the daypilot component.

Current version: 8.4.3068

Comment posted by Martin Säfsten
5 years ago.

I tried updating to the latest version of daypilot.

Looks like the same error after:

TypeError: e.style is not a function
daypilot-angular.min.js:32
at e:\Git\ePlanering\EPL.FrontEnd\node_modules\daypilot-pro-angular\daypilot-angular.min.js:32:21269
at e:\Git\ePlanering\EPL.FrontEnd\node_modules\daypilot-pro-angular\daypilot-angular.min.js:32:22166
at Object../node_modules/daypilot-pro-angular/daypilot-angular.min.js (e:\Git\ePlanering\EPL.FrontEnd\node_modules\daypilot-pro-angular\daypilot-angular.min.js:32:22169)
at __webpack_require__ (http://localhost:4200/runtime.js:77:30)

Version: 2018.2.3281

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

Martin-

Angular 6 requires DayPilot Pro version 2018.2.3281 or later:
https://javascript.daypilot.org/daypilot-pro-for-javascript-2018-2-3281/

I'm not able to reproduce the error with that version. There is also a sample Angular 6 project that compiles and runs fine - you can give it a try:

https://code.daypilot.org/34811/angular-6-scheduler

Please let me know if you are able to reproduce the problem with the tutorial code.

Sometimes, it's necessary to create a new project for Angular 6 and copy the project source over. Or at least to delete node_modules and run "npm install" again.

If you are using "ng update" please see also the following thread:
https://forums.daypilot.org/Topic.aspx/4257/angular-6-issue

Comment posted by Martin Säfsten
5 years ago.

Hey Dan,

so a full clear of node_modules revealed another error. Thanks for providing the example code, it helped me find the solution for the new error.

I had a instance of the type "DayPilot.Angular.Scheduler" in my angular component. After looking at the example code, I switched to using the DayPilotSchedulerComponent instead.

Now it's up and running, and so far so good.

About the bug in Angular CLI, I did get that error, and my solution was to remove the daypilot-pro-angular package from package.json while I was doing the ng update. After the migration was done, I put it back and did another npm install.

Maybe that's what caused this error, and doing a clean npm install fixed any wierdness. Wouldn't be the first time a partial npm install broke something, unfortunately...

Thanks for the help Dan!

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

Hi Martin,

Great, thanks for the update.

The original namespace (DayPilot.Angular.*) has been removed in the latest release (https://javascript.daypilot.org/daypilot-pro-for-javascript-2018-2-3281/). Just for reference, the migration to the current syntax is described here:
https://code.daypilot.org/47032/angular-2-scheduler-ahead-of-time-aot-compilation

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