Skip to content

Missing tsconfig.json causes react-native-builder-bob build failure #10

Description

@scantarbian

Issue

When installing this package from GitHub (e.g., github:scantarbian/react-native-zebra-linkos), the postinstall script fails because the package is missing a tsconfig.json file in the project root.

Error

✖ Building target typescript
ℹ Cleaning up previous build at lib/typescript
ℹ Compiling 3 files in src with babel
ℹ Compiling 3 files in src with babel
ℹ Generating type definitions with tsc
✖ Couldn't find a tsconfig.json in the project root.
...
Error: Failed to build definition files.

Expected Behavior

The package should include a tsconfig.json (or tsconfig.build.json as referenced in react-native-builder-bob config) so that the typescript target can be built during postinstall.

Current package.json react-native-builder-bob config:

"react-native-builder-bob": {
  "source": "src",
  "output": "lib",
  "targets": [
    ["commonjs", { "esm": true }],
    ["module", { "esm": true }],
    ["typescript", { "project": "tsconfig.build.json" }]
  ]
}

The typescript target references tsconfig.build.json which doesn't exist in the repository.

Suggested Fix

Add a tsconfig.build.json file to the project root that configures TypeScript to output declaration files from src/ to lib/typescript/src/.

Impact

Without this fix, packages installed from GitHub will have missing lib/ directory, causing:

  • ESLint import/no-unresolved errors
  • Runtime import failures
  • Missing TypeScript type definitions at lib/typescript/src/index.d.ts

Metadata

Metadata

Assignees

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