vue.jsmongooseelectronelectron-buildervue-cli-5

Cannot require mongoose in vue-electron-builder


I have set up my project using vue cli , electron-builder and vuetify. in my background.js(main.js for electron) I am facing error when I require mongoose. There are 46 errors about mongoose related to cannot use await outside async function, and needing a appropriate loader to handle file.

this is mt Github repository - https://github.com/Silentgamerz/Stonks

I tried following this - https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/57, but still didn't work. even this post has same error - Error when including mongoose in Electron Vue app, but for me it is not working even after externalizing mongoose.


Solution

  • Nevermind it worked once i recreated the project for some reason.