Skip to content

[bug]: NodeJs - Property 'replaceAll' does not exist on type 'string'. #1559

Closed
algolia/api-clients-automation
#3897
@risalfajar

Description

@risalfajar

Description

I want to use Algolia library in my Firebase Cloud Functions project, but when I'm trying to deploy a function, it throws an error:

node_modules/@algolia/client-common/src/transporter/helpers.ts:42:11 - error TS2550: Property 'replaceAll' does not exist on type 'string'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2021' or later.

So I add this to my tsconfig:

{
    "compilerOptions": {
        "lib": [
          "ES2021.String"
        ]
    }
}

But then the error changed:

node_modules/@algolia/client-common/src/cache/createBrowserLocalStorageCache.ts:10:41 - error TS2304: Cannot find name 'window'.

Client

Search

Version

5.7.0

Relevant log output

Running command: npm --prefix "$RESOURCE_DIR" run build

> build
> tsc && tsc-alias

node_modules/@algolia/client-common/src/transporter/helpers.ts:42:11 - error TS2550: Property 'replaceAll' does not exist on type 'string'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2021' or later.

42         ).replaceAll('+', '%20')}`,
             ~~~~~~~~~~


Found 1 error in node_modules/@algolia/client-common/src/transporter/helpers.ts:42


Error: functions predeploy error: Command terminated with non-zero exit code 2

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