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
Calling the import function with an empty array fails.
Steps to reproduce
Initialize a collection and try to call import with an empty array:
constdocuments=[];returnawaittsClient.collections<T>('testcollection').documents().import(documents);// this fails
Expected Behavior
It doesn't fail.
Actual Behavior
It fails with this error:
/Users/<path-to-project>/node_modules/typesense/src/Typesense/Documents.ts:342
.map((r) => JSON.parse(r)) as ImportResponse[];
^
SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at /Users/<path-to-project>/node_modules/typesense/src/Typesense/Documents.ts:342:26
at Array.map (<anonymous>)
at Documents.<anonymous> (/Users/<path-to-project>/node_modules/typesense/src/Typesense/Documents.ts:342:10)
at step (/Users/<path-to-project>/node_modules/typesense/lib/Typesense/Documents.js:48:23)
at Object.next (/Users/<path-to-project>/node_modules/typesense/lib/Typesense/Documents.js:29:53)
at fulfilled (/Users/<path-to-project>/node_modules/typesense/lib/Typesense/Documents.js:20:58)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
Metadata
Typesense Version: 0.25.1
OS: Run in Docker
The text was updated successfully, but these errors were encountered:
davideaimar
changed the title
Import with empty array fail
Import with empty array fails
Dec 18, 2023
Description
Calling the
import
function with an empty array fails.Steps to reproduce
Initialize a collection and try to call import with an empty array:
Expected Behavior
It doesn't fail.
Actual Behavior
It fails with this error:
Metadata
Typesense Version: 0.25.1
OS: Run in Docker
The text was updated successfully, but these errors were encountered: