Skip to content

Property 'replaceAll' does not exist on type 'string' #152

@michaeldev5

Description

@michaeldev5

Check existing issues

Ox Version

0.11.1

Current Behavior

Hello Ox team,

I’m running into TypeScript compilation errors caused by ox when it’s used as a transitive dependency of one of my packages. I am facing the typescript errors below. Is increasing the 'lib' compiler option the only solution to this problem?

@paraspell/sdk:compile: ../../node_modules/.pnpm/ox@0.11.1_typescript@5.9.3_zod@4.2.1/node_modules/ox/core/Base64.ts:81:28 - 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.
@paraspell/sdk:compile: 
@paraspell/sdk:compile: 81   if (url) base64 = base64.replaceAll('+', '-').replaceAll('/', '_')
@paraspell/sdk:compile:                               ~~~~~~~~~~
@paraspell/sdk:compile: 
@paraspell/sdk:compile: ../../node_modules/.pnpm/ox@0.11.1_typescript@5.9.3_zod@4.2.1/node_modules/ox/core/Errors.ts:27:12 - error TS4113: This member cannot have an 'override' modifier because it is not declared in the base class 'Error'.
@paraspell/sdk:compile: 
@paraspell/sdk:compile: 27   override cause: cause
@paraspell/sdk:compile:               ~~~~~
@paraspell/sdk:compile: 
@paraspell/sdk:compile: ../../node_modules/.pnpm/ox@0.11.1_typescript@5.9.3_zod@4.2.1/node_modules/ox/core/Errors.ts:89:20 - error TS2554: Expected 0-1 arguments, but got 2.
@paraspell/sdk:compile: 
@paraspell/sdk:compile: 89     super(message, options.cause ? { cause: options.cause } : undefined)
@paraspell/sdk:compile:                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@paraspell/sdk:compile: 
@paraspell/sdk:compile: 
@paraspell/sdk:compile: Found 3 errors in 2 files.
@paraspell/sdk:compile: 
@paraspell/sdk:compile: Errors  Files
@paraspell/sdk:compile:      1  ../../node_modules/.pnpm/ox@0.11.1_typescript@5.9.3_zod@4.2.1/node_modules/ox/core/Base64.ts:81
@paraspell/sdk:compile:      2  ../../node_modules/.pnpm/ox@0.11.1_typescript@5.9.3_zod@4.2.1/node_modules/ox/core/Errors.ts:27
@paraspell/sdk:compile:  ELIFECYCLE  Command failed with exit code 2.
@paraspell/sdk:compile: ERROR: command finished with error: command (/Users/michael/Projects/xcm-tools/packages/sdk) /opt/homebrew/bin/pnpm run compile exited (2)
@paraspell/sdk#compile: command (/Users/michael/Projects/xcm-tools/packages/sdk) /opt/homebrew/bin/pnpm run compile exited (2)

 Tasks:    9 successful, 12 total
Cached:    3 cached, 12 total
  Time:    7.651s 
Failed:    @paraspell/sdk#compile

 ERROR  run failed: command  exited (2)

Thank you,
With kind regards, @paraspell

Expected Behavior

There are no errors during build.

Steps To Reproduce

No response

Link to Minimal Reproducible Example

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions