Skip to content

Conversation

@saseungmin
Copy link

@saseungmin saseungmin commented Oct 28, 2025

Problem

Users with verbatimModuleSyntax: true in their TypeScript config get errors:

error TS1484: 'TapjoyEvent' is a type and must be imported using a type-only import
image

Root causes:

  1. package.json react-native field points to source files (src/index)
  2. Declared lib/module/ directory doesn't exist
  3. Type imports don't use import type syntax

Solution

  • ✅ Add ESM build configuration
  • ✅ Generate lib/module/ output
  • ✅ Update package.json to use compiled output
  • ✅ Fix type-only imports in source files
  • ✅ Remove unnecessary CommonJS build

Changes

  • Added tsconfig.build.json for ESM compilation
  • Added build scripts to package.json
  • Updated react-native field: src/indexlib/module/index.js
  • Fixed imports in src/index.ts, src/Tapjoy.ts, src/TJOfferwallDiscoverView.tsx

Breaking Changes

None. This is a bug fix that makes the package work as originally intended.

…bility

- Add ESM build configuration (tsconfig.build.json)
- Generate lib/module/ with ES modules instead of exposing src/
- Update package.json to point to compiled output
- Fix type-only imports in src files
- Remove unnecessary CommonJS build

This fixes TypeScript errors when verbatimModuleSyntax is enabled.
Users were getting TS1484 errors because:
1. react-native field pointed to source files (src/index)
2. Source files used regular imports for types
3. lib/module/ directory was missing despite being declared
@saseungmin saseungmin requested a review from a team as a code owner October 28, 2025 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant