Skip to content

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

@IchordeDionysos

Description

@IchordeDionysos

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

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

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