Skip to content

Transitive dependency on deprecated uuid@3.x breaks Electron production builds #106

@Harukisatoh

Description

@Harukisatoh

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-adapter

Everything 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. 🤔

Image

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/core brings 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:

  1. It's not immediately obvious - The app works in dev, so developers won't catch it until they try to ship
  2. It affects Electron users specifically - The combination of electron-builder + ESM modules makes this a blocker
  3. The root cause is deprecated dependencies - Specifically request@2.88.2 which 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. 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions