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.

Vue 3 (beta) support

See original GitHub issue

I installed the fullcalendar library to my Vue 3 project but when I serve the application, I get a warning in my terminal that says ""export ‘default’ (imported as ‘Vue’) was not found in ‘vue’ ".

This crashes the app with the same error when I open the browser. I tried creating the shim.d.ts with the required content but this doesnt still solve the problem.

Here is the vue component script tag.

<script lang="ts">
import { defineComponent } from "vue";
import FullCalendar from "@fullcalendar/vue";
import dayGridPlugin from "@fullcalendar/daygrid";
import interactionPlugin from "@fullcalendar/interaction";

const Calendars = defineComponent({
  components: {
    FullCalendar
  },
  setup() {
    const calendarOptions = {
      plugins: [ dayGridPlugin, interactionPlugin ],
      initialView: "dayGridMonth"
    }

    return { calendarOptions }
  }
});

export default Calendars;
</script>

Is there any workaround for this or is this library not supported with Vue 3?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:13
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

12reactions
pikaxcommented, Feb 5, 2021

I have this simple component to make fullcalendar work on vue3 + vite

// needed to make sure the `vdom` loads before everything else - fix for vite
import "@fullcalendar/core/vdom";
import { Calendar, CalendarOptions } from "@fullcalendar/core";
import {
  defineComponent,
  h,
  onMounted,
  onUnmounted,
  ref,
  watchEffect,
} from "vue";

export default defineComponent({
  props: {
    options: Object as () => CalendarOptions,
  },

  setup(props) {
    const el = ref<HTMLElement>();

    const calendar = ref<Calendar>();

    onMounted(() => {
      calendar.value = new Calendar(el.value!, props.options);
      calendar.value.render();
    });

    watchEffect(() => {
      if (calendar.value) {
        calendar.value.pauseRendering();
        calendar.value.resetOptions(props.options);
        calendar.value.resumeRendering();
      }
    });

    onUnmounted(() => {
      calendar.value?.destroy();
    });

    return () => h("div", { ref: el });
  },
});
8reactions
arshawcommented, Nov 5, 2020

a PR with Vue v3 support would be very welcome!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vue 3 as the New Default
TL;DR: Vue 3 is now the new default version as of Monday, February 7, 2022! Make sure to read the Potential Required Actions...
Read more >
Vue 3 Beta is released – Learn the latest news
Both Vue Router and Vuex are Vue 3 ready already - in alpha version. Vue cli comes with experimental support for the moment....
Read more >
Vue 3 Beta - Installation and New Features - YouTube
As one of four official Vue.js partners, the Modus team was excited to dive into the newly released Vue 3.0.0- beta.1 and explore...
Read more >
Get started with Vuetify 3
Get started with Vuetify, the world's most popular Vue.js framework for building feature rich, blazing fast applications. #Installation. To get started with ...
Read more >
Vuetify 3 has gone beta, meaning its API is now stable - Reddit
Why so slow on Vue3 support! Have opted for Quasar on latest project. No regrets so far ;).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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