Open appidisr opened 6 years ago
Can you give a sample/snippet of code you are running that generates that error? Electron Edge is a fork of the EdgeJS library which is what is in reference. Without more context I cannot tell if it is an issue with the printer-dymo library, or something else.
Hello Paul,
Thanks for your response!
I used your code by chaning the printer name:
var printerDymo = require('printer-dymo'), fs = require('fs');
// It takes a second or two for initialization to complete. setTimeout(function(){
// Gets an array of IPrinter objects (Dymo printers on the current system)
printerDymo.getPrintersAsync(null, function(err, printers){
if (err) throw err;
console.log(printers);
});
// A print object;
var printArgs = {
printer: 'DYMO LabelWriter Wireless', //name of printer
jobTitle: 'My Sweet Labels',
labels:[{
filename: 'test.label', //path to label
fields: {
name: 'Timmy',
barcode: '100360931'
},
images: {
photo: fs.readFileSync('face.png')
}
}]
};
printerDymo.print(printArgs, function(err, res){
if (err) throw err;
console.log("Finished Printing.");
});
}, 2000);
Here is the error from cmd:
C:\NodeJs\MyNodeJSApps\printer-dymo-master\printer-dymo-master>node dymoprint.js Printer-Dymo: getPrinterAsync() triggered C:\NodeJs\MyNodeJSApps\printer-dymo-master\printer-dymo-master\node_modules\printer-dymo\node_modules\electron-edge-js\lib\edge.js:182 return edge.initializeClrFunc(options); ^
TypeError: Cannot read property 'initializeClrFunc' of undefined at Object.exports.func (C:\NodeJs\MyNodeJSApps\printer-dymo-master\printer-dymo-master\node_modules\printer-dymo\node_modules\electron-edge-js\lib\edge.js:182:17) at Object.module.exports.getPrintersAsync (C:\NodeJs\MyNodeJSApps\printer-dymo-master\printer-dymo-master\node_modules\printer-dymo\index.js:51:31) at Timeout._onTimeout (C:\NodeJs\MyNodeJSApps\printer-dymo-master\printer-dymo-master\dymoprint.js:8:14) at ontimeout (timers.js:498:11) at tryOnTimeout (timers.js:323:5) at Timer.listOnTimeout (timers.js:290:5)
Were you able to find the solution for this?
Error seems to be from C:\NodeJs\printer-dymo-master\printer-dymo-master\node_modules\printer-dymo\node_modules\electron-edge-js\lib\edge.js