ferdikoomen / openapi-typescript-codegen

NodeJS library that generates Typescript or Javascript clients based on the OpenAPI specification
MIT License
2.88k stars 519 forks source link

ts compile errors when using axios tsconfig instructions #1557

Open troysas opened 1 year ago

troysas commented 1 year ago

When following the instructions for using axios here https://github.com/ferdikoomen/openapi-typescript-codegen/blob/HEAD/docs/axios-support.md

I get the following error when compiling. I'm not familiar enough with ts to know which of these valid options should replace the

"..."

in the lib option.

The error I get is: ERROR in /Users/td/git/client/ui/tsconfig.json(21,13): TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref'.

Here's VSCode providing similar message when hovering over the "..." value for lib in tsconfig.json.

image

thanks for your help.

troysas commented 1 year ago

I changed the line to

    "lib": ["es2020", "dom"],

to get error to go away. Not sure if that will work, but it's better than "...". :)