Vue 2.x Nuxt Refresh Problem

Hello,

I’ve began using the Gantt Library.
I’ve been closely following this tutorial https://dhtmlx.com/blog/use-dhtmlxgantt-vue-js-framework-demo/?utm_source=automation&utm_medium=email&utm_campaign=gantt_eval&utm_term=vue&utm_content=first_email

It’s working, however when I refresh the page (with F5 or Ctrl+R) I get RuntimeError, and enigmatic message that Window is not defined.

My stack is Vue 2.x + Nuxt + Typescript.

I’ve been thinking that it might have been a problem with SSR that Nuxt is providing, but wrapping gantt component with “client-only” tag doesn’t work either.

Kind regards.

Hi,

sorry for the long delay.

We don’t have any ready answer for this, since we don’t do much work on Vuejs at the moment.
If the issue is still relevant - can you please attach some kind of demo so we could test the issue locally?

Hi.

I belive that I’ve found a solution - so it might be a reference to fellow developers:

@Component({
  components: {
    WeeklyIcon,
    Breadcrumbs,
    TopBar,
    Gantt: () => {
        if (process.client) {
           return import('~/components/specific/schedule/ScheduleGantt.vue')
        }
    },
  },
})