Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

498
Views
Nuxt throwing error : Uncaught TypeError: Cannot call a class as a function

I am using drawflow npm library in my Vuejs/Nuxtjs application but when I start the application I get the following error in my console:

classCallCheck.js:3 Uncaught TypeError: Cannot call a class as a function
    at _classCallCheck (classCallCheck.js:3)

Following are the steps I have followed as per documentation:

  1. Install the drawflow using npm i drawflow --save
  2. Create a drawflow.js file under plugins folder and add the code:
import Vue from 'vue'
import Drwaflow from 'drawflow'
Vue.use(Drwaflow)
  1. Modify the nuxt-config.js file and add the plugin and build:
plugins: [
    { src: "~/plugins/drawflow", mode:"client" }
  ],

  build: {
    transpile: ["drawflow"]
  },
  1. My Vue Component has following in Mounted function:
  async mounted () {
    const vm = this

    if (process.browser) {
      const Drawflow = await require('drawflow')
      // const styleDrawflow = await require('drawflow/dist/drawflow.min.css')
      Vue.use(Drawflow)

      const id = document.getElementById('drawflow')
      console.log(id)
      vm.editor = new Drawflow(id, Vue, vm)
      vm.editor.start()
    }
  }

Not understand what's wrong here. Could not find any relevant post for Nuxt. Can someone please explain what's wrong with this code?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Even if this question could work with some more work, at the end, OP wants to have it working locally.
The solution for this use case is available here and working from my PoV.

I hence do not recommend taking the plugins path to prevent having it available on the whole SPA globally.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!