Closed powershek closed 4 months ago
Hello @powershek,
Please provide a bit more information. Reproducible demo or at least code snippet.
What typescript version do you use?
I search the printer, result as below ,
{"bdAddress": "",
"deviceName": "TM-T88VI",
"deviceType": "TYPE_PRINTER",
"ipAddress": "192.168.68.61",
"macAddress": "F8:25:51:7C:10:3B",
"target": "TCP:F8:25:51:7C:10:3B"
}
and I store the information to AsyncStorage and retrieve to use in the new Printer function
new Printer({ target: printer.target, deviceName: printer.deviceName, })
I still using js to make my project. any information need please let me know . Thank you very much
@powershek please show me the screenshot with error, I wanna see stacktrace. Also please show me how you do import from the lib
async function SimplePrint() {
let printerlist = await API.getAllPrinter();
console.log("printerlist====================", printerlist)
let advmodemainprinter = await API.getAdvModeMainPrinter();
console.log("advmodemainprinter====================", advmodemainprinter)
let targerPrinterObj = printerlist.filter((filteritem) => filteritem.TID == advmodemainprinter)[0]
let targerPrinter = printerlist.filter((filteritem) => filteritem.TID == advmodemainprinter)[0].selectedprinter
console.log("targerPrinter====================", targerPrinter)
setPrinter(targerPrinterObj)
console.log("targerPrinterObj====================", targerPrinterObj)
console.log("targerPrinterObj dtl====================", targerPrinterObj.item.target, targerPrinterObj.item.modal)
let printerInstance2 = new Printer({
target: `{targerPrinterObj.item.target}`,
deviceName: targerPrinterObj.item.modal,
})
}
For some reason, my message was not posted, but I've installed bare react native project (JS) version 0.66.0 and tried to reproduce your issue. Unfortunately not luck... Everything works as expected.
For now, I'll close the issue bit If you could provide a reproducible demo please feel free to reopen it
I found the issue happen in Printer.ts,
Problem on this line,
this.queue = new PQueue({ concurrency: 1 });
Could you please help
@powershek hi,
As I said - no issue with the lib. I've checked on React Native (0.66 JS) bare project. Something wrong on your end.
Please try on a clean project. If you want you can create a reproducible demo or upload to github.
BTW you said previously that you project uses JS (not TypeScript), but on screenshots above you do logging in TS files. So what are using JS or TS?
@powershek hi,
As I said - no issue with the lib. I've checked on React Native (0.66 JS) bare project. Something wrong on your end.
Please try on a clean project. If you want you can create a reproducible demo or upload to github.
BTW you said previously that you project uses JS (not TypeScript), but on screenshots above you do logging in TS files. So what are using JS or TS?
I am using JS, I console log to the nearest line to check which line throw error. So i directly edit Printer.ts
I am trying the 4.0.0-beta.5 version, I can search the printer, once I create a new Printer as below, I got this error. Please help
Error: Unhandled promise rejection [TypeError: privateMap.get is not a function. (In 'privateMap.get(receiver)', 'privateMap.get' is undefined)]
Environment : react-native: 0.66.0 react: 16.13.1 react-native-esc-pos-printer: 4.0.0-beta.5