fullcalendar / fullcalendar-angular

The official Angular component for FullCalendar
https://fullcalendar.io/docs/angular
MIT License
1.07k stars 175 forks source link

IE11 Console Error Msg "SCRIPT1053: Const must be initialized" Calendar not rendering #367

Closed pford23 closed 3 years ago

pford23 commented 3 years ago

Problem / Bug

The following error is displayed in the console when trying to use the fullcalendar with angular in the IE11.

error-msg-console-ie11

Clicking on the location will bring up the following.

error-code-section-ie11

This code section can be found in the node_modules\@fullcalendar\angular\fesm2015\fullcalendar-angular.js line 36-44

The const in a for-in loop is not supported by IE11 the funny thing is that the example project works in IE11.

Json FIles

I managed to replicate the problem from my employers project by creating an empty angular project and adding the fullcalendar with the following setup.

package.json dependecies

package-json-deps

tsconfig.json

tsconfig-json

The angular.json file was not changed and used as generated by the CLI.

Polyfills.js is identical to the example project polyfill.js

Replicate

Create new angular project with the above package.json dependencies and tsconfig.json file. Add fullcalender to app.component. Aboce error msg will appear in console in IE11.

My Thoughts

Is it possible that it may have to do with the angular and Typescript version? My project uses Angular 9 the example project Angular 10. Typescript versions are also different my project version 3.8.3 example project version 3.9.7

arshaw commented 3 years ago

I discovered there's a way to modify the example project to output more IE-friendly JS (there is no problem with the @fullcalendar/angular package)

https://github.com/fullcalendar/fullcalendar-angular/issues/353#issuecomment-853358184