Typescript error
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 30/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- typescript
- Ambito
- build-system
Direzione di ricerca
Riproducete il fallimento della compilazione di TypeScript 5.6.2 e ispezionate le dichiarazioni segnalate in node_modules/lru-cache/dist/commonjs/index.d.ts, in particolare entries, keys, values, Symbol.iterator e forEach. Il problema è risolto quando il progetto viene compilato senza questi errori TS2416.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
When compiling with Typescript 5.6.2 I get the following error:
output
node_modules/lru-cache/dist/commonjs/index.d.ts:973:5 - error TS2416: Property 'entries' in type 'LRUCache<K, V, FC>' is not assignable to the same property in base type 'Map<K, V>'.
Type '() => Generator<[K, V], void, unknown>' is not assignable to type '() => MapIterator<[K, V]>'.
Call signature return types 'Generator<[K, V], void, unknown>' and 'MapIterator<[K, V]>' are incompatible.
The types returned by 'next(...)' are incompatible between these types.
Type 'IteratorResult<[K, V], void>' is not assignable to type 'IteratorResult<[K, V], undefined>'.
Type 'IteratorReturnResult<void>' is not assignable to type 'IteratorResult<[K, V], undefined>'.
Type 'IteratorReturnResult<void>' is not assignable to type 'IteratorReturnResult<undefined>'.
Type 'void' is not assignable to type 'undefined'.
973 entries(): Generator<[K, V], void, unknown>;
~~~~~~~
node_modules/lru-cache/dist/commonjs/index.d.ts:985:5 - error TS2416: Property 'keys' in type 'LRUCache<K, V, FC>' is not assignable to the same property in base type 'Map<K, V>'.
Type '() => Generator<K, void, unknown>' is not assignable to type '() => MapIterator<K>'.
Call signature return types 'Generator<K, void, unknown>' and 'MapIterator<K>' are incompatible.
The types returned by 'next(...)' are incompatible between these types.
Type 'IteratorResult<K, void>' is not assignable to type 'IteratorResult<K, undefined>'.
Type 'IteratorReturnResult<void>' is not assignable to type 'IteratorResult<K, undefined>'.
Type 'IteratorReturnResult<void>' is not assignable to type 'IteratorReturnResult<undefined>'.
Type 'void' is not assignable to type 'undefined'.
985 keys(): Generator<K, void, unknown>;
~~~~
node_modules/lru-cache/dist/commonjs/index.d.ts:997:5 - error TS2416: Property 'values' in type 'LRUCache<K, V, FC>' is not assignable to the same property in base type 'Map<K, V>'.
Type '() => Generator<V, void, unknown>' is not assignable to type '() => MapIterator<V>'.
Call signature return types 'Generator<V, void, unknown>' and 'MapIterator<V>' are incompatible.
The types returned by 'next(...)' are incompatible between these types.
Type 'IteratorResult<V, void>' is not assignable to type 'IteratorResult<V, undefined>'.
Type 'IteratorReturnResult<void>' is not assignable to type 'IteratorResult<V, undefined>'.
Type 'IteratorReturnResult<void>' is not assignable to type 'IteratorReturnResult<undefined>'.
Type 'void' is not assignable to type 'undefined'.
997 values(): Generator<V, void, unknown>;
~~~~~~
node_modules/lru-cache/dist/commonjs/index.d.ts:1009:5 - error TS2416: Property '[Symbol.iterator]' in type 'LRUCache<K, V, FC>' is not assignable to the same property in base type 'Map<K, V>'.
Type '() => Generator<[K, V], void, unknown>' is not assignable to type '() => MapIterator<[K, V]>'.
Call signature return types 'Generator<[K, V], void, unknown>' and 'MapIterator<[K, V]>' are incompatible.
The types returned by 'next(...)' are incompatible between these types.
Type 'IteratorResult<[K, V], void>' is not assignable to type 'IteratorResult<[K, V], undefined>'.
Type 'IteratorReturnResult<void>' is not assignable to type 'IteratorResult<[K, V], undefined>'.
Type 'IteratorReturnResult<void>' is not assignable to type 'IteratorReturnResult<undefined>'.
Type 'void' is not assignable to type 'undefined'.
1009 [Symbol.iterator](): Generator<[K, V], void, unknown>;
~~~~~~~~~~~~~~~~~
node_modules/lru-cache/dist/commonjs/index.d.ts:1032:5 - error TS2416: Property 'forEach' in type 'LRUCache<K, V, FC>' is not assignable to the same property in base type 'Map<K, V>'.
Type '(fn: (v: V, k: K, self: LRUCache<K, V, FC>) => any, thisp?: any) => void' is not assignable to type '(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any) => void'.
Types of parameters 'fn' and 'callbackfn' are incompatible.
Types of parameters 'map' and 'self' are incompatible.
Type 'LRUCache<K, V, FC>' is not assignable to type 'Map<K, V>'.
The types returned by 'entries().next(...)' are incompatible between these types.
Type 'IteratorResult<[K, V], void>' is not assignable to type 'IteratorResult<[K, V], undefined>'.
Type 'IteratorReturnResult<void>' is not assignable to type 'IteratorResult<[K, V], undefined>'.
Type 'IteratorReturnResult<void>' is not assignable to type 'IteratorReturnResult<undefined>'.
Type 'void' is not assignable to type 'undefined'.
1032 forEach(fn: (v: V, k: K, self: LRUCache<K, V, FC>) => any, thisp?: any): void;
~~~~~~~
- Lingua principale
- TypeScript
- Stelle
- 10
- Fork
- 3
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Issue simili
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
tomjn/coilbox-hub#454 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
api: spanner
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
googleapis/google-cloud-node#9513 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 92/100
I maintainer di solito rispondono entro 1 giorno
-
SegmentedControl calls Math.random() during render, breaking Next.js cacheComponents prerenderingAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
mantinedev/mantine#9244 ·
I maintainer di solito rispondono entro 8 giorni