You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you try to use the react module pinned to 17.0.2, it ignores the version when choosing the x-typescript-types header. Below is the url I used and the types header I got for it. The types header should be 17.0.2 like the module I'm importing.
This also applies to deps. If I make a request to the following, the types has no information about the dependency versions. In this example, the types ends up importing "https://cdn.esm.sh/v58/@types/react@17.0.37/index.d.ts" which is the wrong version of react. Having 2 different types files for react causes typescript errors due to duplicate identifiers.
error: TS2300 [ERROR]: Duplicate identifier 'LibraryManagedAttributes'.
type LibraryManagedAttributes<C, P> = C extends React.MemoExoticComponent<infer T> | React.LazyExoticComponent<infer T>
~~~~~~~~~~~~~~~~~~~~~~~~
at https://cdn.esm.sh/v58/@types/react@17.0.35/index.d.ts:3100:14
'LibraryManagedAttributes' was also declared here.
type LibraryManagedAttributes<C, P> = C extends React.MemoExoticComponent<infer T> | React.LazyExoticComponent<infer T>
~~~~~~~~~~~~~~~~~~~~~~~~
at https://cdn.esm.sh/v58/@types/react@17.0.37/index.d.ts:3100:14
Additional info
esm.sh version: v58
The text was updated successfully, but these errors were encountered:
It appears most other react based modules are using 17.0.37. to resolve this error I import 17.0.2 but use a deno types comment to have it use the 17.0.37 types instead of the 17.0.35 types from the x-typesceipt-types header.
Ideally the types would always match the version specified. I think I might have tried 17.0.2 types but they were not working. I don't recall.
Issue
If you try to use the react module pinned to 17.0.2, it ignores the version when choosing the x-typescript-types header. Below is the url I used and the types header I got for it. The types header should be 17.0.2 like the module I'm importing.
https://esm.sh/react@17.0.2
x-typescript-types
https://cdn.esm.sh/v58/@types/react@17.0.35/index.d.ts
This also applies to deps. If I make a request to the following, the types has no information about the dependency versions. In this example, the types ends up importing "https://cdn.esm.sh/v58/@types/react@17.0.37/index.d.ts" which is the wrong version of react. Having 2 different types files for react causes typescript errors due to duplicate identifiers.
https://esm.sh/react-router-dom@6.2.1?deps=react@17.0.2,history@5.1.0
x-typescript-types
https://cdn.esm.sh/v58/react-router-dom@6.2.1/index.d.ts
Additional info
The text was updated successfully, but these errors were encountered: