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

Build errors with Typescript 4.7.4 #345

Closed
WorldMaker opened this issue Jul 7, 2022 · 4 comments
Closed

Build errors with Typescript 4.7.4 #345

WorldMaker opened this issue Jul 7, 2022 · 4 comments

Comments

@WorldMaker
Copy link

IxJS version: 4.5.2

Code to reproduce:

Using @reactivex/ix-ts in webpack (4) with fork-ts-checker-webpack-plugin (6) and Typescript (4.7.4).

tsconfig.json excerpt:

{
  "compilerOptions": {
    "lib": ["dom", "es2015", "es2015.iterable", "esnext.asynciterable"],
    "downlevelIteration": true
  }
}

Expected behavior:

Compiles without errors originating in node_modules/@reactivex/ix-ts.

Actual behavior:

ERROR in node_modules/@reactivex/ix-ts/asynciterable/asynciterablex.ts:173:35
TS2339: Property 'toNodeStream' does not exist on type 'AsyncIterableX<any>'.
    171 |           // prettier-ignore
    172 |           return isReadableNodeStream(prev) ? prev.pipe(next, {end}) :
  > 173 |             asAsyncIterable(prev).toNodeStream(readableOpts(next)).pipe(next, {end});
        |                                   ^^^^^^^^^^^^
    174 |         }
    175 |       }
    176 |       return prev;

ERROR in node_modules/@reactivex/ix-ts/asynciterable/operators/withabort.ts:19:47
TS2554: Expected 0 arguments, but got 1.
    17 |
    18 |   [Symbol.asyncIterator](): AsyncIterator<TSource> {
  > 19 |     return this._source[Symbol.asyncIterator](this._signal);
    20 |   }
    21 | }
    22 |

ERROR in node_modules/@reactivex/ix-ts/iterable/iterablex.ts:142:30
TS2339: Property 'toNodeStream' does not exist on type 'IterableX<any>'.
    140 |           // prettier-ignore
    141 |           return isReadableNodeStream(prev) ? prev.pipe(next, {end}) :
  > 142 |             asIterable(prev).toNodeStream(readableOpts(next)).pipe(next, {end});
        |                              ^^^^^^^^^^^^
    143 |         }
    144 |       }
    145 |       return prev;

Additional information:

The two toNodeStream errors are wrapped in if (isBrowser) blocks so it looks like a simple type leakage from a node lib? Maybe just needs an as any to avoid assuming Node types are available? (Or // @ts-ignore; I don't know how that combines with // prettier-ignore, though.)

The withabort error seems like a simple type fix, perhaps:

private _source: AsyncIterableX<TSource>

Comparing this operator version with the non-operator version in asynciterablex.ts it looks like the difference is instead a // @ts-ignore above the currently erroring line.

@domoritz
Copy link

domoritz commented Dec 2, 2023

Looks like there are more errors with 5.3.2. I get this error in a downstream project

node_modules/ix/asynciterable/asasynciterable.d.ts:5:18 - error TS2320: Interface 'AsyncIterableTransform<T>' cannot simultaneously extend types 'Transform' and 'AsyncIterableX<T>'.
  Named property 'every' of types 'Transform' and 'AsyncIterableX<T>' are not identical.

5 export interface AsyncIterableTransform<T> extends AsyncIterableX<T>, Transform {
...

@domoritz
Copy link

domoritz commented Apr 8, 2024

Could you make a new release so that we get this fix in arrow?

@trxcllnt
Copy link
Member

trxcllnt commented Apr 8, 2024

@domoritz yes I can

@domoritz
Copy link

Great, let me know and I'll update the dependency in arrow to remove the type errors.

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

3 participants