Skip to content

Bindings fail on Node due to uniffi-bindgen-react-native importing TypeScript #34

@criccomini

Description

@criccomini

I've been hacking around trying to get the Node bindings to work today. It appears that uniffi-bindgen-node generates bindings that import the runtime from uniffi-bindgen-react-native:

import { ... } from "uniffi-bindgen-react-native";

This makes the generated package unusable on Node 24, because uniffi-bindgen-react-native resolves its main entrypoint to a TypeScript file under node_modules:

{
"main": "./typescript/src/index.ts"
}

Node 24 rejects that at runtime with:

Error [ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING]: Stripping types is currently unsupported for files under node_modules, for ".../node_modules/uniffi-bindgen-react-native/typescript/src/index.ts"

Repro

Environment:

  • uniffi-bindgen-node 0.1.4
  • Node v24.3.0

Generate bindings for any UniFFI crate, build the generated package, then try to load it:

require("./dist/uniffi/generated/index.js")

This fails before user code runs because the generated binding transitively requires uniffi-bindgen-react-native, whose runtime entrypoint is a .ts file in node_modules.

I'm not sure what the best way to address this is. It appears that @jhugman has published uniffi-runtime-javascript, but this doesn't work for uniffi-bindgen-node since it's for WASM runtimes only.

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