#string.endsWith() does not exist?

30 messages · Page 1 of 1 (latest)

dusty path
#

Getting an error that's basically saying that endsWith() does not exist on type string

fresh needle
#

have you tried changing the target library to 'es2015' or later

dusty path
#

it's es2023

#

so yes

#

I have

#

(originally it was es2016 and it still broke)

fresh needle
#

how are you running the CLI

dusty path
#

from Visual Studio

fresh needle
#

visual studio for ts?

#

weird but ok

#

anyways

#

is it passing any command line args? if so then it won't pick up the tsconfig unless specified

dusty path
#

i've just run this

fresh needle
#

ok that's just running it from the terminal, not from your ide

dusty path
#

?

fresh needle
#

you'd have to specify the project manually to use the tsconfg, or you can use the command line to specify the lib

#

or you can just use plain tsc in the project root so it can pick up the tsconfig on its own

dusty path
#

wait how do I do that?

#

ok so just ran tsc in the home root and still got this error

fresh needle
#

assuming you're already in your project root, you can use one of these

tsc
tsc --project ./tsconfig.json
tsc -p ./tsconfig.json
tsc ./util/saves.ts --project ./tsconfig.json
tsc ./util/saves.ts -p ./tsconfig.json
```otherwise, this will work
```sh
tsc ./util/saves.ts --lib=es2015
fresh needle
dusty path
#

figured that out

fresh needle
#

ok do you have the es2023 in your tsconfig

dusty path
#

I did lol. fixed

#

that is no longer an issue

fresh needle
#

!resolved