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
We encountered the issue Type instantiation is excessively deep and possibly infinite.ts(2589) while upgrading algoliasearch from v5.1 to v5.15 and working with Immer produce function and SearchResponse type.
The issue stems from two types: highlightResult and snippetResult(which both have the same structure). They create a recursive reference in the Yaml definition here where highlightResultMap and highlightResultArray both reference the same highlightResult.
highlightResultArray:
type: arraydescription: Surround words that match the query with HTML tags for highlighting.items:
$ref: '#/highlightResult'highlightResultMap:
type: objectdescription: Surround words that match the query with HTML tags for highlighting.additionalProperties:
x-additionalPropertiesName: attribute$ref: '#/highlightResult'highlightResult:
oneOf:
- $ref: '#/highlightResultOption'
- $ref: '#/highlightResultMap'
- $ref: '#/highlightResultArray'
This type actually changed in the previous commits and did not create any issue in v5.1.0. Last working version is 5.3.2.
We see two possible fixes:
Create a new highlightResultLevelTwo that won't reference highlightResultMap or highlightResultArray and breaks the cycle.
Description
We encountered the issue
Type instantiation is excessively deep and possibly infinite.ts(2589)
while upgrading algoliasearch from v5.1 to v5.15 and working with Immerproduce
function andSearchResponse
type.Here's a reproducible example of the issue:
The issue stems from two types:
highlightResult
andsnippetResult
(which both have the same structure). They create a recursive reference in the Yaml definition here wherehighlightResultMap
andhighlightResultArray
both reference the samehighlightResult
.This type actually changed in the previous commits and did not create any issue in v5.1.0. Last working version is 5.3.2.
We see two possible fixes:
highlightResultLevelTwo
that won't referencehighlightResultMap
orhighlightResultArray
and breaks the cycle.HighlightResult
as genericThanks!
Client
Search
Version
5.15.0
Relevant log output
No response
The text was updated successfully, but these errors were encountered: