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.

[V4] Importing of Fullcalendar Resource

See original GitHub issue

Hi

In version 4.0 when i try import the resource core in angular using:

import ‘@fullcalendar/resource-common’;

It seems to cause havoc, what is the correct ES6 way of importing the resource-common?

All my imports in my angular component as follows:

import { Calendar } from ‘@fullcalendar/core’; import momentPlugin from ‘@fullcalendar/moment’; import {toMoment } from ‘@fullcalendar/moment’; import dayGridPlugin from ‘@fullcalendar/daygrid’; import timeGridPlugin from ‘@fullcalendar/timegrid’; import listGridPlugin from ‘@fullcalendar/list’; import ‘@fullcalendar/resource-common’; import resourceTimeGridPlugin from ‘@fullcalendar/resource-timegrid’; import resourceDayGridPlugin from ‘@fullcalendar/resource-daygrid’; import momentTimezonePlugin from ‘@fullcalendar/moment-timezone’;

It seems to break the entire calendar - multiple typescript compilation errors etc.

ERROR in node_modules/@fullcalendar/core/main.d.ts(2724,14): error TS2484: Export declaration conflicts with exported declaration of 'OptionsInput'.
node_modules/@fullcalendar/core/main.d.ts(2725,26): error TS2484: Export declaration conflicts with exported declaration of 'EventDef'.
node_modules/@fullcalendar/core/main.d.ts(2751,14): error TS2484: Export declaration conflicts with exported declaration of 'Calendar'.
node_modules/@fullcalendar/core/main.d.ts(2758,24): error TS2484: Export declaration conflicts with exported declaration of 'DateSpanApi'.
node_modules/@fullcalendar/core/main.d.ts(2758,37): error TS2484: Export declaration conflicts with exported declaration of 'DatePointApi'.
node_modules/@fullcalendar/core/main.d.ts(2778,35): error TS2484: Export declaration conflicts with exported declaration of 'CalendarState'.
node_modules/@fullcalendar/core/main.d.ts(2787,14): error TS2484: Export declaration conflicts with exported declaration of 'EventMutation'.
node_modules/@fullcalendar/core/main.d.ts(2789,14): error TS2484: Export declaration conflicts with exported declaration of 'EventApi'.

What is the correct way to import this?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
ganySAcommented, Mar 29, 2019

Solved - Typescript was at 3.1.1 and this needs 3.2.4+

1reaction
acerixcommented, Mar 28, 2019

Oh sorry, I missed that page and didn’t realise it had changed.

But, I added this code to the example project to test it:

import resourceTimeGridPlugin from '@fullcalendar/resource-timegrid';
import resourceDayGridPlugin from '@fullcalendar/resource-daygrid';

At first I got “Cannot find module”, but it works fine after installing the modules with:

npm install --save @fullcalendar/resource-daygrid @fullcalendar/resource-timegrid

So it sounds like you are doing it correctly, maybe you need to update TypeScript or clear some old files that are cached.

Read more comments on GitHub >

github_iconTop Results From Across the Web

V4 Release Notes and Upgrade Guide - Docs v4 - FullCalendar
Top-level utility functions that were called like $.fullCalendar.formatDate() must now be accessed like import { formatDate } from '@fullcalendar/core' or via ...
Read more >
How to use "resources" in v4 ng-fullcalendar? - Stack Overflow
The syntax "resources" isn't recognized in fullcalendar v4. ... import { Component, ViewChild } from '@angular/core'; import { OptionsInput, ...
Read more >
fullcalendar/resource-timeline - npm
Usage ; import { Calendar } ; } from '@fullcalendar/core' ; import resourceTimelinePlugin from ; '@fullcalendar/resource-timeline' const calendarEl ; = ...
Read more >
fullcalendar/resource-timeline/main.d.ts - UNPKG
2, import '@fullcalendar/premium-common';. 3, import { TimelineCoords, TimelineDateProfile, TimelineLaneCoreProps } from '@fullcalendar/timeline';. 4 ...
Read more >
Angular Fullcalendar Resource Time Grid Day - StackBlitz
import { Component, ViewChild, OnInit } from ... import dayGridPlugin from "@fullcalendar/. daygrid";. import interactionPlugin, { Draggable } from.
Read more >

github_iconTop Related Medium Post

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