Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

Uncaught Error: Please import the top-level fullcalendar lib before attempting to import a plugin. #446

Closed
kota-yata opened this issue Aug 24, 2020 · 4 comments

Comments

@kota-yata
Copy link

When I tried to use fullcalendar V5, I got an error like so:
image

Code

import FullCalendar from 'svelte-fullcalendar';
import interactionPlugin from '@fullcalendar/interaction';
import dayGridPlugin from '@fullcalendar/daygrid';
import jaLocal from '@fullcalendar/core/locales/ja';

import '@fullcalendar/core/main.min.css';
import '@fullcalendar/daygrid/main.min.css';

const handleDateClick = (event) => {
  console.log(event);
};

<div class='Calendar'>
  <FullCalendar
    droppable={true}
    editable={true}
    defaultView='dayGridMonth'
    header={{ left: 'prevYear,prev,next,nextYear', center: 'title', right: 'today' }}
    locale='jaLocal'
    buttonText={{ today: '今月に戻る' }}
    plugins={[dayGridPlugin, interactionPlugin]}
    on:dateClick={(event) => handleDateClick(event)} />
</div>
@YogliB
Copy link
Owner

YogliB commented Sep 11, 2020

Hi, I suggest you try the new version :)

@YogliB YogliB closed this as completed Sep 11, 2020
@ethanstan
Copy link

Hi,

I am also getting this error on the latest version using just the sample code.

"Please import the top-level fullcalendar lib before attempting to import a plugin."

@kota-yata
Copy link
Author

@ethanstan
Try

export default {
...
  resolve({
    browser: true,
    dedupe: ['svelte', '@fullcalendar/common'],
  }),
}

into rollup.config.js

This issue is gonna help you :)

@ethanstan
Copy link

Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants