Algolia NPM Library Throwing Errors on TypeScript based Firebase Cloud Function

I am building a firebase cloud function using typescript version 3.2.2

I installed the algolia package like this:

npm install algoliasearch --save

Then I imported it using:

import algoliasearch from ‘algoliasearch’;

Now if I try to deploy my functions even without writing any new function for Algolia, I get lots of errors such as these:

1894 readonly disablePrefixOnAttributes?: readonly string;

node_modules/@algolia/client-search/dist/client-search.d.ts:1898:5 - error TS1128: Declaration or statement expected.

1898 readonly disableExactOnAttributes?: readonly string;
~~~~~~~~

node_modules/@algolia/client-search/dist/client-search.d.ts:1898:39 - error TS1109: Expression expected.

1898 readonly disableExactOnAttributes?: readonly string;
~

node_modules/@algolia/client-search/dist/client-search.d.ts:1898:50 - error TS1005: ‘;’ expected.

1898 readonly disableExactOnAttributes?: readonly string;
~~~~~~

node_modules/@algolia/client-search/dist/client-search.d.ts:1898:57 - error TS1011: An element access expression should take an argument.

This is just a snapshot of many errors.

Can you please help??!!

Ok this is resolved as I had a very old version of firebase

1 Like