Skip to content

[BUG] RPC Method Proxy Issues: Export and Usability #858

@alpgul

Description

@alpgul

RPC methods are being proxied, which makes usage difficult. In the index.d.ts file, export is specified, but the generated index.js exports a Proxy. This also causes a "not found" error, similar to the example. RPC methods should be moved outside the proxy.

export default new Proxy(Entrypoint, classProxyHooks);

lib.rs:

#[wasm_bindgen]
pub async fn greet()

build/index.d.ts:

export function greet(): void;

demo.ts:

import {greet} from "./build/index.js" //throw error not found greet

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions