diff --git a/crates/napi/src/bindgen_runtime/module_register.rs b/crates/napi/src/bindgen_runtime/module_register.rs index fc0c273a..6137b2b5 100644 --- a/crates/napi/src/bindgen_runtime/module_register.rs +++ b/crates/napi/src/bindgen_runtime/module_register.rs @@ -88,8 +88,11 @@ unsafe impl Sync for PersistedSingleThreadHashMap {} lazy_static! { static ref MODULE_REGISTER_CALLBACK: ModuleRegisterCallback = Default::default(); static ref MODULE_CLASS_PROPERTIES: ModuleClassProperty = Default::default(); - // compatibility for #[module_exports] - #[cfg(feature = "compat-mode")] +} + +#[cfg(feature = "compat-mode")] +// compatibility for #[module_exports] +lazy_static! { static ref MODULE_EXPORTS: PersistedSingleThreadVec = Default::default(); } diff --git a/examples/napi/Cargo.toml b/examples/napi/Cargo.toml index d7b58c95..2fc11d9f 100644 --- a/examples/napi/Cargo.toml +++ b/examples/napi/Cargo.toml @@ -10,7 +10,7 @@ crate-type = ["cdylib"] [dependencies] futures = "0.3" -napi = {path = "../../crates/napi", features = ["full"]} +napi = {path = "../../crates/napi", default-features = false, features = ["napi8", "tokio_rt", "serde-json", "async", "experimental", "latin1"]} napi-derive = {path = "../../crates/macro", features = ["type-def"]} serde = "1" serde_derive = "1"