ramda / types

MIT License
26 stars 21 forks source link

Issues with upgrading from 0.28.25 to 0.29.1 when using yarn PnP #92

Open nemanja-tosic opened 7 months ago

nemanja-tosic commented 7 months ago

We've recently upgraded from 0.28.25 to 0.29.1 and started having build issues along the lines of

error TS7006: Parameter 'user' implicitly has an 'any' type.

Coming from a function that looks like this (note: a lot of code has been redacted):

export const getUsers = curry(
  async (id: string): Promise<User[]> => {
    // ...
  }
);

// ...

import { getUsers } from '@package/getUsers.js';

// the user param is the one with an implicit any
await getUsers(id)).map(async user => {

As i was looking through the differences, i've noticed that 0.28.25 produces a d.ts which includes a triple slash import

/// <reference types="ts-toolbelt" />
...
getUsers: import("Function/Curry").Curry<(id: string) => Promise<User[]>>;

whereas 0.29.1 does not do that and produces something like below

getUsers: import("ts-toolbelt/out/Function/Curry.js").Curry<(id: string) => Promise<User[]>>;

Installing ts-toolbelt in the project resolves build issues.

Harris-Miller commented 7 months ago

I'm not really sure why 0.28.25 would have had that /// <reference types="ts-toolbelt" /> line in there. The second import seems correct, and ts-toolbelt is a direct dependency: https://github.com/ramda/types/blob/develop/package.json#L51. So it should always be there installed and able to be referenced.

I'm not familiar with yarn PnP at all either. But my gut tells me that the issue is with yarn and not types-ramda itself. I've never seen this issue myself in any npm or pnpm backed project