Skip to content

Conversation

@nicolasmsg
Copy link
Contributor

@nicolasmsg nicolasmsg commented Dec 20, 2023

Checklist

  • Changelog updated
  • Reference to automated issues tests
  • Tested by a V&V

How was it done

Upgrade serialport version to v11.0.1

⚠️ DO NOT MERGE THIS PR YET.

  • Todo : upgrade node to v18.17

  • For now serialport has a bug in it's types see that causes compilation to fail:

Error: node_modules/@serialport/stream/dist/index.d.ts(101,5): error TS2416: Property '_write' in type 'SerialPortStream<T>' is not assignable to the same property in base type 'Duplex'.
  Type '(data: Buffer, encoding: BufferEncoding | undefined, callback: (error: Error | null) => void) => void' is not assignable to type '(chunk: any, encoding: string, callback: (error?: Error | null | undefined) => void) => void'.
    Types of parameters 'encoding' and 'encoding' are incompatible.
      Type 'string' is not assignable to type 'BufferEncoding | undefined'.

A pull request has been created to fix it but has not been merged yet.

For now, we have to manually change a file in flow-analyzer-com-communicator/node_modules/@serialport/stream/dist/index.d.ts
Replace:

_write(data: Buffer, encoding: BufferEncoding | undefined, callback: (error: Error | null) => void): void;

with:

_write(data: Buffer, encoding: BufferEncoding, callback: (error: Error | null) => void): void;

@pierreroth64 pierreroth64 merged commit 664262b into master Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants