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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pattern napi_bigint not covered #276

Closed
KillerCodeMonkey opened this issue Nov 2, 2020 · 14 comments
Closed

Pattern napi_bigint not covered #276

KillerCodeMonkey opened this issue Nov 2, 2020 · 14 comments
Labels
bug Something isn't working

Comments

@KillerCodeMonkey
Copy link

KillerCodeMonkey commented Nov 2, 2020

I am really new to rust and all that universe.

i tried to install napi and so on, but i get:

error[E0004]: non-exhaustive patterns: `napi_bigint` not covered
   --> ../.cargo/registry/src/github.com-1ecc6299db9ec823/napi-0.5.1/src/js_values/value_type.rs:46:11
    |
46  |     match value {
    |           ^^^^^ pattern `napi_bigint` not covered
    | 
   ::: ../target/debug/build/napi-sys-c52f7ba1a7f9b699/out/bindings.rs:358:5
    |
358 |     napi_bigint = 9,
    |     ----------- not covered
    |
    = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
    = note: the matched value is of type `napi_sys::napi_valuetype`

Thanks :)

@Brooooooklyn
Copy link
Sponsor Member

Seems like you are using non-stable NodeJS version. Please upgrade to latest LTS NodeJS and try again

@KillerCodeMonkey
Copy link
Author

▶ cargo test
   Compiling napi v0.5.1
error[E0004]: non-exhaustive patterns: `napi_bigint` not covered
   --> ../.cargo/registry/src/github.com-1ecc6299db9ec823/napi-0.5.1/src/js_values/value_type.rs:46:11
    |
46  |     match value {
    |           ^^^^^ pattern `napi_bigint` not covered
    | 
   ::: ../target/debug/build/napi-sys-c52f7ba1a7f9b699/out/bindings.rs:358:5
    |
358 |     napi_bigint = 9,
    |     ----------- not covered
    |
    = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
    = note: the matched value is of type `napi_sys::napi_valuetype`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0004`.
error: could not compile `napi`.

To learn more, run the command again with --verbose.
▶ node -v
v14.15.0

No luck :(.

To describe my problem more:
I have a workspace rust project, where i have two libs:

  1. the rust part
  2. the node wrapper (will use first one later)

evencargo install fails with

▶ cargo install
error: no packages found with binaries or examples

my .toml for the node part:

[package]
name = "read-media-node"
version = "0.1.0"
authors = ["Bengt Weiße <bengtler@gmail.com>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lib]
crate-type = ["cdylib"]

[dependencies]
napi = "0.5"
napi-derive = "0.5"

[build-dependencies]
napi-build = "0.2"

@adumbidiot
Copy link
Collaborator

How was nodejs installed?

@KillerCodeMonkey
Copy link
Author

KillerCodeMonkey commented Nov 3, 2020 via email

@MoutOgm
Copy link

MoutOgm commented Nov 4, 2020

I have same with nidejs v12.13

@Azorlogh
Copy link

Azorlogh commented Nov 4, 2020

It seems to be because the #[cfg(napi6)] isn't validated. I have no idea why though, I couldn't figure out what's supposed to set it true in the first place.

@Brooooooklyn Brooooooklyn added the bug Something isn't working label Nov 4, 2020
@Brooooooklyn
Copy link
Sponsor Member

Brooooooklyn commented Nov 4, 2020

This issue is expected to be fixed by #271 (comment)

@KillerCodeMonkey
Copy link
Author

thanks for letting us know.

@Brooooooklyn
Copy link
Sponsor Member

The root cause of this problem is in some NodeJS version, process.versions.napi was not set to the right value which expected to match with the NAPI_VERSION in node_api.h.

It may be temporary fixed by using node@12.13+ versions, which was fully tested.

@adumbidiot
Copy link
Collaborator

It may be temporary fixed by using node@12.13+ versions, which was fully tested.

If the above error is the only error that occurs while compiling, you might be able to work-around by using the master branch. I believe #278 works around this by throwing an error when it encounters types it can't understand.

@adumbidiot
Copy link
Collaborator

Also, cargo install is for installing binaries. Maybe you meant cargo update or cargo build?

@Brooooooklyn
Copy link
Sponsor Member

Should be closed in #290

@KillerCodeMonkey
Copy link
Author

@Brooooooklyn is there already a new release with the fix?

@Brooooooklyn
Copy link
Sponsor Member

@KillerCodeMonkey Fixed in master branch but not released yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants