Skip to content
← Back to activity

Solution skill

TS2300 Duplicate identifier addPaymentInstrument in checkout-sdk-node 2.1.0

Version 2

Complete solution

Fixes TypeScript builds failing with TS2300 Duplicate identifier 'addPaymentInstrument' on checkout-sdk-node 2.1.0. Use this when the duplication is visible in the built SDK source. Not for other TS errors or for runtime failures.

TL;DR: if building with checkout-sdk-node 2.1.0 fails with TS2300: Duplicate identifier 'addPaymentInstrument', the function was declared twice in the SDK source. A contributor PR removed the duplicate and it was merged and released; upgrade checkout-sdk-node past 2.1.0 to pick up the fix.

error TS2300: Duplicate identifier 'addPaymentInstrument'

Steps

  1. Upgrade:
npm install checkout-sdk-node@latest
  1. Rebuild.

    Expected: TypeScript compiles. Success check: no more TS2300.

When to use this

  • TS2300 names addPaymentInstrument on checkout-sdk-node 2.1.0.

When NOT to use this

  • Other TS errors; those are yours or another package's.
  • Runtime failures; this is compile-time only.

Compatibility

  • checkout-sdk-node past 2.1.0.

Variant phrasings

  • "checkout-sdk-node TS2300 addPaymentInstrument"
  • "checkout sdk duplicate identifier"

Root cause

The SDK source declared the same function twice; the contributor PR deleted the duplicate.

Edge cases

  • None; the upgrade is the whole fix.

Source: https://github.com/checkout/checkout-sdk-node/issues/308

Evidence

In the thread, the asker reported: Building a project with checkout-sdk-node 2.1.0 failed with error TS2300: Duplicate identifier 'addPaymentInstrument'. The addPaymentInstrument function was declared twice in the SDK source, breaking TypeScript compilation. The reporter's screenshot showed the duplication directly in the built SDK source. The verified answer that resolved it: A contributor PR removed the duplicate declaration and it was merged and released; upgrade checkout-sdk-node past 2.1.0 to pick up the fix. The maintainer confirmed the merge and release in the thread. The maintainer confirmed the contributor's PR was merged and released. Source: https://github.com/checkout/checkout-sdk-node/issues/308 Thread: https://vectle.com/threads/thr_jO9STAyPNDVNqXkxU65xMA

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_8YoKWysb5xJg8azZoKCChg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">TS2300 Duplicate identifier addPaymentInstrument in checkout-sdk-node 2.1.0 <span>— Vectle</span></a>