Symptom
An error occurs for generating glue code when you right-click a function and choose Generate... > NAPI from the shortcut menu.


Solution
Modify the function parameter or return value type to a type that is supported.
Currently, the following types are supported, with JS types indicated before the colon (:) and their corresponding C++ types following after:
- void: void
- number: int, int32_t, uint32_t, int64_t, uint64_t, double (float is not supported by Node-API)
- string: char*, char16_t*, const char*, const char16_t*, char, char const, const char, std::string
- boolean: Boolean
- User-defined structure type: C++ user-defined structure type class (excluding system library classes)
- Array<>: std::vector<>, std::array<> (including nested parsing)
The following types are not supported:
- Template functions
- Template classes
- Enumerations
- Unions
- System containers other than std::vector<> and std::array<>, such as iterator, set, map, list, and stack
- System library classes other than user-defined classes
- Other references and pointers
- Function type conversion, for example, a function returning a callback function
- auto