dsandor / dymojs

A pure javascript library for printing labels on a Dymo Labelwriter printer from the browser or from nodejs.
128 stars 30 forks source link

(node:26972) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' #16

Open tonissimo opened 3 years ago

tonissimo commented 3 years ago

I am using DymoJS to print labels on my local machine and I get this error:

(node:26972) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.

I tried installing ssl-root-cas (https://www.npmjs.com/package/ssl-root-cas) but that does not help. I also tried changing NODE_TLS_REJECT_UNAUTHORIZED to '1' in dymojs's index.js but it does not work either.

cpgb85 commented 3 years ago

Same issue here. Ever figure this out?

tonissimo commented 3 years ago

Yes, for me what solved the issue was to put the first line of the XML label on the same line as the opening backtick. (I previously had the first XML line on the next line). I hope it helps!

Screen Shot 2021-03-25 at 3 48 54 PM
einaraglen commented 3 years ago

I did what @tonissimo suggested, and it did not seem to change anything, I then moved the line :

dymo.print("DYMO LabelWriter Wireless", labelXml);

And placed it under the string XML, and that seem to work just fine! it is printing now!

EDIT: and I also changed name of Printer as I am using the Wireless verison

kardall commented 2 years ago

Yes, for me what solved the issue was to put the first line of the XML label on the same line as the opening backtick. (I previously had the first XML line on the next line). I hope it helps!

Screen Shot 2021-03-25 at 3 48 54 PM

This is the reason that I love github...

Totally a different error message, but I decided to look at what the newest error was since it really hasn't been maintained well. This XML string is what breaks the new 8.7.2+ Drivers...

Was having CORS problems and all that... as soon as I removed the linefeed after the ` the problem resolved itself... amazing...