FG
๐Ÿ”Œ APIs & SDKsStripe

The library doesn't work on Deno.

Freshabout 21 hours ago
Mar 14, 20260 views
Confidence Score53%
53%

Problem

Describe the bug It was fixed in https://github.com/stripe/stripe-node/issues/997, but as I've pointed out in https://github.com/stripe/stripe-node/issues/997#issuecomment-1115941961, it doesn't work anymore. Maybe it's a regression. To Reproduce See https://github.com/stripe-samples/stripe-node-deno-samples/issues/1 for a description on how to reproduce. Expected behavior No TypeScript errors. Code snippets _No response_ OS macOS Node version Deno 1.21.3 Library version Latest API version 2020-08-27 Additional context Deno compatibility should be verified in CI, to prevent regressions.

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix โ€“ Awaiting Verification

Re-enable Deno Compatibility Checks in CI

Medium Risk

The library's Deno compatibility was previously fixed, but recent changes may have introduced regressions. The lack of continuous integration (CI) checks for Deno compatibility allows these issues to go unnoticed.

Awaiting Verification

Be the first to verify this fix

  1. 1

    Add Deno Compatibility Tests

    Create a dedicated test suite for Deno compatibility that runs during CI. This will help catch any regressions in the future.

    typescript
    import { Stripe } from 'stripe';
    
    const stripe = new Stripe('your_secret_key');
    
    async function testStripe() {
      const customers = await stripe.customers.list();
      console.log(customers);
    }
    testStripe();
  2. 2

    Update CI Configuration

    Modify the CI configuration file (e.g., .github/workflows/ci.yml) to include a job that runs Deno tests.

    yaml
    jobs:
      deno:
        runs-on: ubuntu-latest
        steps:
          - name: Checkout code
            uses: actions/checkout@v2
          - name: Setup Deno
            uses: denoland/setup-deno@v1
          - name: Run Deno Tests
            run: deno test --unstable --allow-net
  3. 3

    Run Tests Locally

    Before pushing changes, run the Deno tests locally to ensure compatibility. This can be done using the Deno CLI.

    bash
    deno test --unstable --allow-net
  4. 4

    Monitor for Errors

    After implementing the tests, monitor the CI pipeline for any errors related to Deno compatibility. Address any issues immediately.

Validation

Confirm that the CI pipeline runs successfully with the new Deno tests and that no TypeScript errors are reported. Additionally, verify that the library functions correctly in a Deno environment by running sample code.

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

stripepaymentsapibug