Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'initializeClrFunc' of undefined #1

Open
appidisr opened this issue Aug 8, 2018 · 4 comments
Open

Comments

@appidisr
Copy link

appidisr commented Aug 8, 2018

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

@paulprins
Copy link
Member

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.

@appidisr
Copy link
Author

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);

@appidisr
Copy link
Author

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)

@ppatriotis
Copy link

Were you able to find the solution for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants