Electron-edge-js not working in Quasar Electron project.
-
Hello everyone.
I am trying to use electron-edge-js to reference a C# .dll in my quasar electron project. But for some reason, it doesn’t work.
I tried electron-edge-js with a standard electron project and it worked great.
I would be very grateful for any recommendation regarding this issue.
Thanks in advance! -
How did you use it in your project? Anyway take alook at boot files for using libs, notenyou cant use require here https://quasar.dev/quasar-cli/cli-documentation/boot-files#Introduction
-
@metalsadman thanks for the reply. I did use require like this.
var edge = require(‘electron-edge-js’)
var getCurrentTime = edge.func({
assemblyFile: baseDll,
typeName: localTypeName,
methodName: ‘GetCurrentTime’
})thanks for the link. I will go and check out boot files.
-
@metalsadman I now added an electron-edge-js boot file like this.
import Vue from ‘vue’
import edge from ‘electron-edge-js’
Vue.prototype.$edge = edgeand replaced my required with the prototype $edge.. But now when I run my project it gives me the same error at startup. So that means the boot file did work but the node module is still an issue.
-
Maybe the node js integration warning gives you the hint, did youbset it to true?
-
@metalsadman No, I didn’t set it to true.
-
Set it to true, but do take note of the warnings.
-
@metalsadman sorry for the late reply. So I did set the integration to true but it still gives me the same error.
-
Im not familiar with that lib sorry, try rebuilding your electron mode, else seek that library’s doc why its giving those errors. It’s a 3rd party lib which is out of quasar scope :/.
-
No, it’s cool! I will try a clean rebuild and see what happens else it is back to googling. Because the doc doesn’t say anything about this error :(.
Anycase thanks for the help. It was very much appreciated. -
@metalsadman Maybe this is the main problem why edge is not working?
"From my experience you cannot webpack edge or edge-js because it contains binary files that are being looked up by path. Perhaps someone has solution for it. You should set edge-js as external and then copy node_modules/edge-js to your working directory"