Search code examples
javascriptreactjstypescripttypes

Import declaration conflicts with local declaration of variable


I have installed @fullcalendar/core & @fullcalendar/daygrid on a Ts based app. when I import is like import { Calendar } from '@fullcalendar/core' import dayGridPlugin from '@fullcalendar/daygrid'

Ts shows: Import declaration conflicts with local declaration of 'Calendar'.ts(2440)

How to resolve this

I was expecting normal execution since this is copied from the npm website code example


Solution

  • I guess, there is Calendar variable/function in your file (where you're trying to import these things).

    To avoid the error you need either to rename your variable/function in your file, or to rename import variable using as like this:

    import { Calendar as FullCalendar } from '@fullcalendar/core'
    import dayGridPlugin from '@fullcalendar/daygrid'
    

    Also, check, if your file not concatenated to another file where Calendar variable could exist