Skip to content

#[napi(js_name = "...")] and #[napi(ts_type = "...")] failing with cfg_attr #2602

@noahbald

Description

@noahbald

Hello, the following fails to compile, which prevents the struct from easily being used in a non-napi context.

#[cfg_attr(feature = "napi", napi(object))]
#[derive(Debug, Clone)]
// expected non-macro attribute, found attribute macro `napi`
// not a non-macro attribute
pub struct MergeStyles(#[napi(js_name = "enabled")] pub bool);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions