0

I followed all steps given in fullcalendar & Angular 5 to set up FullCalendar with Angular 5 project (new project, nothing else added after ng new)

While trying to run ng serve command, I'm getting following errors (& many more)

ng serve
** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
Date: 2018-03-05T14:44:41.420Z
Hash: 33eefe59976d9e67375d
Time: 3084ms
chunk {inline} inline.bundle.js (inline) 3.85 kB [entry] [rendered]
chunk {main} main.bundle.js (main) 2.91 kB [initial] [rendered]
chunk {polyfills} polyfills.bundle.js (polyfills) 577 bytes [initial] [rendered]
chunk {scripts} scripts.bundle.js (scripts) 456 kB [initial] [rendered]
chunk {styles} styles.bundle.js (styles) 113 kB [initial] [rendered]
chunk {vendor} vendor.bundle.js (vendor) 852 kB [initial] [rendered]

ERROR in node_modules/fullcalendar- scheduler/node_modules/fullcalendar/dist/fullcalendar.d.ts(60,15): error TS2451: Cannot redeclare block-scoped variable 'dayIDs'.
node_modules/fullcalendar-scheduler/node_modules/fullcalendar/dist/fullcalendar.d.ts(61,15): error TS2451: Cannot redeclare block-scoped variable 'unitsDesc'.
node_modules/fullcalendar-scheduler/node_modules/fullcalendar/dist/fullcalendar.d.ts(94,15): error TS2300: Duplicate identifier 'Default'.
node_modules/fullcalendar-scheduler/node_modules/fullcalendar/dist/fullcalendar.d.ts(98,2): error TS2300: Duplicate identifier 'default'.
node_modules/fullcalendar-scheduler/node_modules/fullcalendar/dist/fullcalendar.d.ts(110,15): error TS2300: Duplicate identifier 'Default'.
node_modules/fullcalendar-scheduler/node_modules/fullcalendar/dist/fullcalendar.d.ts(119,2): error TS2300: Duplicate identifier 'default'.
node_modules/fullcalendar-scheduler/node_modules/fullcalendar/dist/fullcalendar.d.ts(123,15): error TS2300: Duplicate identifier 'Default'.
node_modules/fullcalendar-scheduler/node_modules/fullcalendar/dist/fullcalendar.d.ts(142,2): error TS2300: Duplicate identifier 'default'.
node_modules/fullcalendar-scheduler/node_modules/fullcalendar/dist/fullcalendar.d.ts(146,15): error TS2300: Duplicate identifier 'Default'.
node_modules/fullcalendar-scheduler/node_modules/fullcalendar/dist/fullcalendar.d.ts(160,2): error TS2300: Duplicate identifier 'default'.
node_modules/fullcalendar-scheduler/node_modules/fullcalendar/dist/fullcalendar.d.ts(163,15): error TS2451: Cannot redeclare block-scoped variable 'globalDefaults'.
node_modules/fullcalendar-scheduler/node_modules/fullcalendar/dist/fullcalendar.d.ts(223,15): error TS2451: Cannot redeclare block-scoped variable 'englishDefaults'.
node_modules/fullcalendar-scheduler/node_modules/fullcalendar/dist/fullcalendar.d.ts(226,15): error TS2451: Cannot redeclare block-scoped variable 'rtlDefaults'.
node_modules/fullcalendar-scheduler/node_modules/fullcalendar/dist/fullcalendar.d.ts(248,15): error TS2300: Duplicate identifier 'Default'.
node_modules/fullcalendar-scheduler/node_modules/fullcalendar/dist/fullcalendar.d.ts(253,2): error TS2300: Duplicate identifier 'default'.
node_modules/fullcalendar-scheduler/node_modules/fullcalendar/dist/fullcalendar.d.ts(261,15): error TS2300: Duplicate identifier 'Default'.
node_modules/fullcalendar-scheduler/node_modules/fullcalendar/dist/fullcalendar.d.ts(267,2): error TS2300: Duplicate identifier 'default'.
node_modules/fullcalendar-scheduler/node_modules/fullcalendar/dist/fullcalendar.d.ts(272,15): error TS2300: Duplicate identifier 'Default'.

What am I missing and how to solve these Duplicate identifier errors?

Kapil Sharma
  • 10,135
  • 8
  • 37
  • 66
  • rather than anything being missing the word "duplicate" strongly suggests that something is being included more than once... – ADyson Mar 05 '18 at 16:46
  • Yes, but that is in node_modules, not the code written by me. This is not supposed to happen like that thus I'm assuming I did something wrong in configuration/installation. Just couldn't understand what? – Kapil Sharma Mar 05 '18 at 17:25
  • Removing fullcalendar-schedular solves the issue. Fullcalendar-schedular is also having fullcalendar in its dependencies, which was causing issues. – Kapil Sharma Mar 05 '18 at 18:22
  • Ok that's useful to know. If you don't need Scheduler you can certainly remove it. If you do want to use Scheduler, I guess you install just that and not the main fullCalendar package as well. – ADyson Mar 05 '18 at 19:43

3 Answers3

1

The fullcalendar-scheduler version in the package.json file may be preceded with some ~ or ^ symbols which may install the incompatible version with the fullcalender installed in you machine. So specify the exact compatible version for the fullcalendar-scheduler in the packag.json file and also make sure that the installed version is same as we specified in the package.json file by using npm list command.

Sanjay Kumar N S
  • 4,653
  • 4
  • 23
  • 38
-1

Removing fullcalendar-schedular solves the issue. Fullcalendar-schedular is also having fullcalendar in its dependencies, which was causing issues.

Kapil Sharma
  • 10,135
  • 8
  • 37
  • 66
  • If you look at the actual package.json in the sample app from the tutorial, it shows different package versions. Thise will work. Also, what if someone needs schedular? – Aluan Haddad Sep 11 '20 at 18:35
-1

Only set setting "skipLibCheck": true in tsconfig.json this solved my problem. Good luck.

"compilerOptions": {
    "skipLibCheck": true
}
Jared Forth
  • 1,577
  • 6
  • 17
  • 32
Del Eraser
  • 37
  • 2