Skip to content

NPM module alias doesn't allow for module type resolution. #2295

Description

@Jackson-clipboard

Describe the bug

If we use an alias for stripe via npm:
npm i stripe-18@npm:stripe@18.0.0

We are unable to resolve the index.d.ts as a module, although its present within our node modules folder.

To Reproduce

  1. run npm i stripe-18@npm:stripe@18.0.0
  2. Within a .ts file that has access to the node_modules resources:
    import Stripe from 'stripe-18';

This will result in the error:
File '.../node_modules/stripe-18/types/index.d.ts' is not a module.

Expected behavior

We would expect that the module would be able to be resolved via the alias.

Code snippets

npm i stripe-18@npm:stripe@18.0.0
import Stripe from 'stripe-18'

OS

macOS

Node version

Node v18.16.1

Library version

stripe-node v18.0.0

API version

2025-03-31.basil

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    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