examples/star_printer_index.js
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript, nodejs
- Domain
- networking
Research direction
The issue points to examples/star_printer_index.js and the escpos/escpos-network setup; first reproduce the reported net.Socket is not a constructor error and establish whether it runs in a browser or Node.js. Done means a confirmed Ethernet-printing path is identified, or the browser limitation and supported alternative are documented.
Written by the indexing model from the issue text.
Description
examples/star_printer_index.js
async printReceipt() {
const escpos = require('escpos');
escpos.Network = require('escpos-network');
const device = new escpos.Network('192.168.1.48',9100);
const printer = new escpos.Printer(device);
device.open(function () {
printer
.font('a')
.align("STAR_CA")
.style('bu')
.size(1, 1)
.emphasize()
.text('The quick brown fox jumps over the lazy dog')
.cancelEmphasize()
.align("STAR_LA")
.text('Hello, am printing')
.align("STAR_RA")
.barcode('1234567', 'EAN8')
.qrimage('https://github.com/song940/node-escpos', function () {
this.fullCut()
this.close();
});
});
},
am getting this error.. "TypeError: net.Socket is not a constructor"
I read everywhere that via browser I should just forget the TCP support.. is that true? is there any work around to be able to print via ethernet cable? if yes what to do?
Otherwise I think I can go with the usb solution witch I dont prefer.. any help please?
- Dominant language
- TypeScript
- Stars
- 1.6k
- Forks
- 443
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lsongdev/node-escpos
-
[BUG]:Openbug
Difficulty 4/5 3-5 days Newbie friendliness 15/100
lsongdev/node-escpos#447 ·
-
[BUG]: AJCBOSEOpenbug
Difficulty 5/5 Over a week Newbie friendliness 10/100
lsongdev/node-escpos#446 ·
-
Capt BilalOpen
Difficulty 5/5 Over a week Newbie friendliness 1/100
lsongdev/node-escpos#443 ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
lsongdev/node-escpos#442 · 2 reactions ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 38/100
lsongdev/node-escpos#441 · 5 comments · 1 reaction ·
All issues in lsongdev/node-escpos
Similar issues
-
bug via-triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
pingdotgg/t3code#15221 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
521xueweihan/HelloGitHub#3847 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
MystenLabs/MemWal#1085 · 1 comment ·
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 1/5 Under an hour Newbie friendliness 92/100
PhyberApex/kuroshiro#1187 ·
Maintainers usually reply within 1 day