Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Runtime type error when return String in non_blocking mode #76

Closed
kayac-chang opened this issue Jun 1, 2022 · 1 comment
Closed

Comments

@kayac-chang
Copy link
Contributor

kayac-chang commented Jun 1, 2022

Problem

Rust Source Code

#[deno_bindgen(non_blocking)]
fn say_hello() -> String {
    String::from("Hello, kirby")
}

Deno Source Code

import { say_hello } from "./bindings/bindings.ts";
say_hello();

Throw Error below 馃槩

error: TS2345 [ERROR]: Argument of type 'Promise<Uint8Array>' is not assignable to parameter of type 'Uint8Array'.
  Type 'Promise<Uint8Array>' is missing the following properties from type 'Uint8Array': BYTES_PER_ELEMENT, buffer, byteLength, byteOffset, and 28 more.
  return decode(result)
                ~~~~~~

TS2773 [ERROR]:     Did you forget to use 'await'?
      return decode(result)
                    ~~~~~~

Possible Solution

take a look #77

@littledivy
Copy link
Member

Fixed in #77

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

No branches or pull requests

2 participants