Skip to content

"tsc: Failed to build definition files." in specific circumstances #196

Open
@hassankhan

Description

@hassankhan

Generating and using a module works within the example app seems to work fine because the snippets in Step 5 import TypeScript directly.

However, this approach presents problems when trying to make use of the Rust module in a separate app (i.e. installing the module with npm i ../<PATH_TO_RUST_MODULE>).

Found 54 errors in 10 files.

Errors  Files
     2  node_modules/uniffi-bindgen-react-native/typescript/src/async-callbacks.ts:25
     1  node_modules/uniffi-bindgen-react-native/typescript/src/async-rust-call.ts:15
     1  node_modules/uniffi-bindgen-react-native/typescript/src/callbacks.ts:36
     1  node_modules/uniffi-bindgen-react-native/typescript/src/enums.ts:7
     1  node_modules/uniffi-bindgen-react-native/typescript/src/errors.ts:41
     5  node_modules/uniffi-bindgen-react-native/typescript/src/ffi-converters.ts:66
     3  node_modules/uniffi-bindgen-react-native/typescript/src/objects.ts:16
     1  node_modules/uniffi-bindgen-react-native/typescript/src/rust-call.ts:14
     1  src/generated/foobar-ffi.ts:300
    38  src/generated/foobar.ts:4
✖ Failed to build definition files.

The errors above are caused by two issues:

I've opened draft PRs for both issues, would love to get feedback on them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions