Skip to content

[bug]: TS error: saveObjects method is missing from SearchIndex type #1578

@aqandrew

Description

@aqandrew

Description

We have a Next.js/DatoCMS site with TypeScript, in the process of adding Algolia search.

Following this guide, which provides a JS code example: https://www.datocms.com/blog/algolia-nextjs-how-to-add-algolia-instantsearch#build-a-next-js-api-to-upload-your-data-to-your-algolia-index

When converted to TypeScript, TS says that SearchIndex does not have a property named saveObjects.

Reproduced here: https://stackblitz.com/edit/vitejs-vite-w8v8abc6?file=src%2Falgolia-sync.ts

Client

All

Version

4.14.2

Relevant log output

Property 'saveObjects' does not exist on type 'SearchIndex'.(2339)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions