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

Incorrect typings of @serialport/bindings-cpp when using ESM #2705

Open
CalmDownVal opened this issue Sep 16, 2023 · 0 comments
Open

Incorrect typings of @serialport/bindings-cpp when using ESM #2705

CalmDownVal opened this issue Sep 16, 2023 · 0 comments

Comments

@CalmDownVal
Copy link

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?

  • 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.

@CalmDownVal 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant