-
-
Notifications
You must be signed in to change notification settings - Fork 35
Description
Hey @node-escpos maintainers! 👋
I'm reaching out because I ran into a blocking issue while integrating @node-escpos/core into my Electron application, and I wanted to share what happened and seek for some advice.
What Happened
I'm building an Electron desktop app (using electron-vite + electron-builder), my project already uses uuid@13.0.0 for generating session IDs, and recently added ESC/POS printer support using your awesome library:
pnpm add @node-escpos/core @node-escpos/usb-adapterEverything worked perfectly in development mode, the printer integration worked great, no errors, smooth sailing.
But then I tried to build for production... and the app completely failed to launch. 🤔
The Problem
After digging through the dependency tree, I found the culprit:
@node-escpos/core@0.6.0
└── qr-image@3.2.0
└── (several deps deep...)
└── request@2.88.2 (deprecated)
└── uuid@3.4.0
So here's what's happening:
- My app uses uuid@13.0.0 (modern ESM version)
@node-escpos/corebrings in uuid@3.4.0 through old dependencies- Development works because electron-vite handles the version conflict gracefully
- Production build fails because electron-builder can't package apps with conflicting uuid versions (ESM vs CommonJS exports)
When I ran pnpm why uuid, I saw both versions in my dependency tree, and electron-builder couldn't resolve them during ASAR packaging.
Why I'm Reporting This
I wanted to let you know about this issue because:
- It's not immediately obvious - The app works in dev, so developers won't catch it until they try to ship
- It affects Electron users specifically - The combination of electron-builder + ESM modules makes this a blocker
- The root cause is deprecated dependencies - Specifically
request@2.88.2which was officially deprecated in 2020
If other devs hit this, they might not understand what's happening.
Environment Details
In case it helps with reproduction:
- Package Manager: pnpm 9.x
- Electron: 38.7.2
- Build Setup: electron-vite + electron-builder
- Module System: ESM (
"type": "module") - Node: 22.x
- TypeScript: moduleResolution: "node16"
Thanks for maintaining this library! The ESC/POS functionality works great otherwise. Let me know if you need any more details. 🙏