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

Illegal Invocation #2882

Open
DjangoJedi opened this issue Aug 20, 2024 · 2 comments
Open

Illegal Invocation #2882

DjangoJedi opened this issue Aug 20, 2024 · 2 comments

Comments

@DjangoJedi
Copy link

SerialPort Version

12

Node Version

16.2.2

Electron Version

28.2.2

Platform

23.3.1.0 Darwin Kernel Version 23.1.0: Mon Oct 9 21:32:11 PDT 2023; root:xnu-10002.41.9~7/RELEASE_ARM64_T6030 arm64

Architecture

No response

Hardware or chipset of serialport

M3

What steps will reproduce the bug?

Hello on Mac I am getting the error "Unable To Communicate With Scales - Dini Argeo, Illegal invocation"

On windows my code works fine. I checked permissions adn ensuring using correct COM ports and all fine. In serial port tool its reading the comsOK.

Anyone else experienced this?? - Appreciate any help thank you


 this.sp = new SerialPort({
      path: this.terminalSettings.attributes.balance_settings.balance1Port,
      baudRate: this.terminalSettings.attributes.balance_settings.balance1Baud,
      autoOpen: false,
    });

    this.sp.on("error", (err) => {
      this.confirmMessage = `Unable To Communicate With Scales - ${this.balance1Type}, ${err.message}`;
      this.showModal("scale_popup");
    });

    this.sp.open((err) => {
      if (err) {
        // Retry opening the port after a delay
        setTimeout(() => this.sp.open(), 1000);
      } else {
        this.parser = this.sp.pipe(new DelimiterParser({ delimiter: "\n" }));
        this.getScale(); // Call getScale in created hook
      }
    });
  },

What happens?

Illegal Invocationg Error

What should have happened?

No Error, work as usual like it does in Windows

Additional information

No response

@DjangoJedi
Copy link
Author

Anyone encountered this??

@Coder-XJ
Copy link

The instance of serialport should be a normal object, not a reactive object

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

2 participants