napi-rs / napi-rs/napi-rs

#[napi(constructor)] | ^^^^^^^^^^^^^^^^^^^^ expected 1 generic argument

Open
#2,111 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
7.9k
Forks
412
Avg merge
1d 20h
Merged PRs (30d)
61

Description

error[E0107]: method takes 1 generic argument but 2 generic arguments were supplied
--> adapter/desktop-glue/src/js_account.rs:8:1
|
8 | #[napi(constructor)]
| ^^^^^^^^^^^^^^^^^^^^ expected 1 generic argument
9 | #[derive(Serialize, Deserialize, Default, Debug)]
10 | pub struct JsAccount {
| --------- help: remove this generic argument
|
note: method defined here, with 1 generic parameter: T
--> /Users/cddengcong/.cargo/registry/src/index.crates.io-6f17d22bba15001f/napi-2.14.1/src/bindgen_runtime/callback_info.rs:121:10
|
121 | pub fn construct<T: ObjectFinalize + 'static>(
| ^^^^^^^^^ -
= note: this error originates in the attribute macro napi (in Nightly builds, run with -Z macro-backtrace for more info)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with adapter/desktop-glue/src/js_account.rs at the #[napi(constructor)] attribute, then inspect napi 2.14.1's bindgen_runtime/callback_info.rs around construct. Reproduce the build and trace the macro-generated call; done means the reported E0107 error no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, rust
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.