bebo925 / ng-thermal-print

Angular module for connecting and printing to thermal printers.
MIT License
42 stars 44 forks source link

- error TS2304: Cannot find name 'USBDevice'. #37

Open rius1212 opened 3 years ago

rius1212 commented 3 years ago

hi bebo925 , i got error when try to start project using ng serve. i already try to use this command npm install @types/w3c-web-usb --only=dev but i still got error like what i put in the title issue. any idea what i need to do ?

ERROR in node_modules/ng-thermal-print/lib/drivers/UsbDriver.d.ts:16:30 - error TS2304: Cannot find name 'USBDevice'.

16 requestUsb(): Observable;


node_modules/ng-thermal-print/lib/drivers/UsbDriver.d.ts:1:23 - error TS2688: Cannot find type definition file for 'w3c-web-usb'.

1 /// <reference types="w3c-web-usb" />
jooskesters commented 3 years ago

having the same issue here

cooper1388 commented 3 years ago

I have the same error, have you been able to solve it?

jooskesters commented 3 years ago

No... I suggest you step away from these libraries and use java.. With java you can copy some printing code from stackoverflow and it will work most of the time. You can then create a background service from your java program that handles the printing jobs ..

This is how I fixed it. Works fine, just some more work then expected when I put my faith in these stupid npm libraries

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Joseph Cooper @.> Sent: Friday, June 11, 2021 7:35:01 PM To: bebo925/ng-thermal-print @.> Cc: jkjoos @.>; Comment @.> Subject: Re: [bebo925/ng-thermal-print] - error TS2304: Cannot find name 'USBDevice'. (#37)

I have the same error, have you been able to solve it?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/bebo925/ng-thermal-print/issues/37#issuecomment-859735886, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKOJMW6ABAHHKIQX2IRPUBDTSJCMLANCNFSM4Y2YFFUQ.