algolia / algolia/algoliasearch-client-javascript

[bug]: algoliasearch doesn't compile with Node 20

Open
#1,594 4 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
1.4k
Forks
226
PR merge metrics
No merged PRs in 30d

Description

### Description

When compiling we get the following error:

```

node_modules/@algolia/client-common/dist/common.d.ts:43:20 - error TS2304: Cannot find name 'Storage'.

43 localStorage?: Storage | undefined;
~~~~~~~
```

Steps to reproduce:
- Run `mkdir algolia-test && cd algolia-test`
- Run `npx gts init`
- When you read `package.json does not exist. Generate:` type `y`
- Run `npm install algoliasearch`
- Run `npm install @types/node@20`
- Add `import {algoliasearch} from 'algoliasearch';` to the top of the `index.ts`
- Run `npm run compile`

### Client

All

### Version

5.35.0

### Relevant log output

```shell
npm run compile

> compile
> tsc

node_modules/@algolia/client-common/dist/common.d.ts:43:20 - error TS2304: Cannot find name 'Storage'.

43 localStorage?: Storage | undefined;
~~~~~~~

Found 1 error in node_modules/@algolia/client-common/dist/common.d.ts:43
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.