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

Upgrading bl@6.0.10 to bl@6.0.12 creates issues #140

Closed
danielpeintner opened this issue Jun 11, 2024 · 3 comments
Closed

Upgrading bl@6.0.10 to bl@6.0.12 creates issues #140

danielpeintner opened this issue Jun 11, 2024 · 3 comments

Comments

@danielpeintner
Copy link

We are running into an issue when upgrading from v6.0.10 to v6.0.12.

node_modules/bl/node_modules/@types/readable-stream/index.d.ts:355:9 - error TS2416: Property 'pipe' in type 'Duplex' is not assignable to the same property in base type '_Writable'.
  Type '<S extends _IWritable>(dest: S, pipeOpts?: { end?: boolean | undefined; } | undefined) => S' is not assignable to type '<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined; } | undefined) => T'.
    Types of parameters 'dest' and 'destination' are incompatible.
      Type 'T' is not assignable to type '_IWritable'.
        Type 'WritableStream' is not assignable to type '_IWritable'.
          The types returned by 'end(...)' are incompatible between these types.
            Type 'void' is not assignable to type '_IWritable'.

355         pipe<S extends _IWritable>(dest: S, pipeOpts?: { end?: boolean | undefined }): S;
            ~~~~

node_modules/mqtt/node_modules/@types/readable-stream/index.d.ts:355:9 - error TS2416: Property 'pipe' in type 'Duplex' is not assignable to the same property in base type '_Writable'.
  Type '<S extends _IWritable>(dest: S, pipeOpts?: { end?: boolean | undefined; } | undefined) => S' is not assignable to type '<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined; } | undefined) => T'.
    Types of parameters 'dest' and 'destination' are incompatible.
      Type 'T' is not assignable to type '_IWritable'.
        Type 'WritableStream' is not assignable to type '_IWritable'.
          The types returned by 'end(...)' are incompatible between these types.
            Type 'void' is not assignable to type '_IWritable'.

355         pipe<S extends _IWritable>(dest: S, pipeOpts?: { end?: boolean | undefined }): S;
            ~~~~

Do you have an idea what might cause this problem?

We noticed that with v6.0.12 it pulls in a new dependency @types/readable-stream@4.0.0 which causes the problems in our case.
Any helps or pointer is appreciated. Thanks!

see also eclipse-thingweb/node-wot#1292

@rvagg
Copy link
Owner

rvagg commented Jun 12, 2024

#133

@kyle-johnson are you able to help out with this one? I don't understand it at all and my instinct is to downgrade the types package to a devdep, but reviewing #133 suggests that's not appropriate.

perhaps it should just be upped to match the readable-stream semver since it's at ^4.0.0 and we're using ^4.2.0 readable-stream so there could be some too-loose reconciliation going on in a complex enough dependency tree.

The two conflicting packages are doing fairly similar things though: https://github.com/mqttjs/MQTT.js/blob/8d5936eda1ca90694f6ae6e95567d4065a8efda3/package.json#L111C13-L122 their readable-stream types allow lower than the actual readable-stream package.

🤷 maybe it's just time to bump both of them.

@danielpeintner
Copy link
Author

FYI: the generated (and attached) package-lock.json has varying versions in it due do external dependencies.
Maybe there is a change between v2 and v4 that causes the issue/inconsistency?

see also eclipse-thingweb/node-wot#1292 (comment)

@danielpeintner
Copy link
Author

FYI: It was an upstream issue with the type definitions we all are using.

@JKRhb from the thingweb team detected and fixed the problem, see DefinitelyTyped/DefinitelyTyped#69974 for more details.

Hence, I am closing the issue...

"@types/readable-stream": "4.0.15" contains the fix!

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

No branches or pull requests

2 participants