responsive-email icon indicating copy to clipboard operation
responsive-email copied to clipboard

TypeScript Declaration Files Not Resolving Properly

Open pgraca97 opened this issue 6 months ago • 1 comments

Package Version: 0.0.4 TypeScript Version: 5.8.3 React Version: 19.1.0 Package Manager: pnpm 10.8.1

Issue Description

TypeScript cannot find declaration files for @responsive-email/react-email when importing components from the package, despite the type definitions existing in the package.

Error Message

Could not find a declaration file for module '@responsive-email/react-email'. 
'/path/to/node_modules/@responsive-email/react-email/dist/index.mjs' implicitly has an 'any' type.
There are types at '/path/to/node_modules/@responsive-email/react-email/dist/index.d.ts', 
but this result could not be resolved when respecting package.json "exports". 
The '@responsive-email/react-email' library may need to update its package.json or typings.

Reproduction Steps

  1. Install the package: pnpm install @responsive-email/react-email
  2. Import components: import { ResponsiveRow, ResponsiveColumn } from "@responsive-email/react-email";
  3. TypeScript reports it cannot find declaration files

I've also tried:

  • Importing from subpaths: import { ResponsiveRow } from "@responsive-email/react-email/responsive-row";
  • Reinstalling the package
  • Clearing the pnpm cache with pnpm store prune

Can you please help me? I want to use the ResponsiveRow and ResponsiveColumn to create a mobile-responsive email with react.email.

pgraca97 avatar Apr 14 '25 16:04 pgraca97