You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Install @serialport/bindings-cpp via Yarn Berry 3.6.3 with PnP
Use with TypeScript 5.2.2, set up with --module ESNext and --module-resolution bundler
Import the AutoDetectTypes type
What happens?
The type is reduced to any as TypeScript fails to load the BindingInterface type from @serialport/bindings-interface
What should have happened?
The type union should get correctly imported and not get reduced to any.
Additional information
I'm aware that Yarn PnP is an experimental feature, however that doesn't seem to be the cause, other modules work totally fine. It seems to be simply an out of date/incomplete package.json exports definition of the @serialport/bindings-interface package.
There is a pull request for the very package, soon about to celebrate its first birthday, that resolves this issue: serialport/bindings-interface#32
I'm opening this issue as the author of the mentioned PR seems to not have done so, or perhaps missed the readme asking to open issues here instead.
The text was updated successfully, but these errors were encountered:
CalmDownVal
changed the title
Can't import @serialport/bindings-cpp when using ESM
Incorrect typings of @serialport/bindings-cpp when using ESM
Sep 16, 2023
SerialPort Version
12.0.1
Node Version
20.6.1
Electron Version
No response
Platform
macOS Ventura 13.4.1
Architecture
ARM
Hardware or chipset of serialport
No response
What steps will reproduce the bug?
@serialport/bindings-cpp
via Yarn Berry 3.6.3 with PnP--module ESNext
and--module-resolution bundler
AutoDetectTypes
typeWhat happens?
The type is reduced to
any
as TypeScript fails to load theBindingInterface
type from@serialport/bindings-interface
What should have happened?
The type union should get correctly imported and not get reduced to
any
.Additional information
I'm aware that Yarn PnP is an experimental feature, however that doesn't seem to be the cause, other modules work totally fine. It seems to be simply an out of date/incomplete
package.json
exports definition of the@serialport/bindings-interface
package.There is a pull request for the very package, soon about to celebrate its first birthday, that resolves this issue: serialport/bindings-interface#32
I'm opening this issue as the author of the mentioned PR seems to not have done so, or perhaps missed the readme asking to open issues here instead.
The text was updated successfully, but these errors were encountered: