Skip to content

package.json module and typings point to files missing from the published tarball (TS7016 for TypeScript consumers) #257

Description

@Prabhakar-Poudel

The published package.json declares:

"module": "dist/widgets.m.js",
"typings": "dist/types/index.d.ts"

Neither file exists in the published tarball (checked 4.0.0 through 4.4.0). The files actually shipped are dist/widgets.js (CJS) and dist/types/src/index.d.ts.

Consequences for npm consumers:

  • TypeScript: import { Widgets } from "@alma/widgets" fails with TS7016: Could not find a declaration file for module '@alma/widgets' — the typings path resolves to nothing.
  • Bundlers that honor module have to fall back to main after failing to resolve dist/widgets.m.js (webpack and vite do this silently; stricter tooling errors).
  • Even after pointing typings manually at dist/types/src/index.d.ts, the emitted declarations import internal @/... path aliases that can't resolve outside your build, so the exported option types (PaymentPlanWidgetOptions etc.) degrade to any.

Current workaround: a local ambient declaration (declare module "@alma/widgets/dist/widgets.js" { export * from "@alma/widgets/dist/types/src/index"; }) plus importing @alma/widgets/dist/widgets.js directly. Corrected field paths (or an exports map) and alias-free emitted .d.ts files would remove the need for it.

Related: #256 — if the published package.json gets touched for that one, both fixes could land in the same patch release.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions