Extending classes required from node_modules



  •  Dev mode.......... electron
     Quasar theme...... mat
     Quasar CLI........ v0.17.9
     Quasar Framework.. v0.17.8
    

    In the electron main process I’m extending the class, taken from node_module:

    const Controller = require('brest-sqlite').Controller
    
    class Locale extends Controller {
      async checkSupportedLocales () {
       //some code here
      }
    }
    
    const locale = new Locale()
    

    And at this point I’m getting:

    TypeError: Class constructor Controller cannot be invoked without 'new'
        at new Locale (webpack:///./src-electron/main-process/controllers/locale-controller.js?:36:97)
        at eval (webpack:///./src-electron/main-process/controllers/locale-controller.js?:107:14)
        at Object../src-electron/main-process/controllers/locale-controller.js (D:\node\updance-quasar\.quasar\electron\electron-main.js:2632:1)
        at __webpack_require__ (D:\node\updance-quasar\.quasar\electron\electron-main.js:21:30)
        at webpackContext (webpack:///./src-electron/main-process/controllers_sync_^\.\/.*\-controller$?:9:9)
        at eval (webpack:///./src-electron/main-process/settings.js?:41:173)
        at Object../src-electron/main-process/settings.js (D:\node\updance-quasar\.quasar\electron\electron-main.js:2692:1)
        at __webpack_require__ (D:\node\updance-quasar\.quasar\electron\electron-main.js:21:30)
        at eval (webpack:///./src-electron/main-process/server.js?:3:16)
        at Object../src-electron/main-process/server.js (D:\node\updance-quasar\.quasar\electron\electron-main.js:2680:1)
    

    I understand that babel is somehow involved in that, but I don’t see what exactly can be done.



  • I have the same problem without electron in the mix. Here’s a repo that demonstrates it: https://github.com/davepuchyr/help-with-quasar. Can anyone help?