problems with Vite, ordering of import statements
See original GitHub issueTo get the FullCalendar Vue plugin working with Vite’s HMR, you’ll need to import @fullcalendar/core/vdom
for its side-effects before any other import. Example from the docs:
import '@fullcalendar/core/vdom' // solves problem with Vite
import FullCalendar from '@fullcalendar/vue'
import dayGridPlugin from '@fullcalendar/daygrid'
import interactionPlugin from '@fullcalendar/interaction'
This configuration is recommended for other bundlers too, not just Vite, because it guarantees the ordering of import statements that FullCalendar internally needs. It prevents the JS error Please import the top-level fullcalendar lib before attempting to import a plugin.
The goal is to do away with this ordering requirement. See the following issue for more info: https://github.com/fullcalendar/fullcalendar/issues/6371
Issue Analytics
- State:
- Created 2 years ago
- Reactions:26
- Comments:14 (1 by maintainers)
Top Results From Across the Web
Console error on import of non-existent file in vite
I am migrating from webpack using Vue2.7 and @vitejs/plugin-vue2. So there was one problem ...
Read more >API - esbuild
If you want to conditionally import a file only if the export is actually used, you should mark the injected file as not...
Read more >Documentation - Module Resolution - TypeScript
Consider an import statement like import { a } from "moduleA" ; in order to check ... If you are having resolution problems...
Read more >Static Asset Handling - Vite
The behavior is similar to webpack's file-loader . The difference is that the import can be either using absolute public paths (based on...
Read more >Getting error `Cannot use import statement outside a module ...
On 10/15/2021 at 11:49 AM, chanced said: I'm using Vite which supports ESM. It doesn't look like it supports ESM with SSR. This...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For anyone else using Vite to build a React application, you need to add this line instead:
import '@fullcalendar/react/dist/vdom';
Man… u are my 🦸♂️ today. I’ve just spent 4 hours trying to get vite to work fullcalendar with the issue:
Please import the top-level fullcalendar lib before attempting to import a plugin.
and that:
import '@fullcalendar/core/vdom'
just saved me another day of searching and punching my monitor. (my hands are hurting already)
Thanks 🙇