reduxjs / redux-toolkit

The official, opinionated, batteries-included toolset for efficient Redux development
https://redux-toolkit.js.org
MIT License
10.55k stars 1.13k forks source link

`@rtk-query/codegen-openapi` missing dependencies #3857

Open ondra-rejnek opened 8 months ago

ondra-rejnek commented 8 months ago

I am trying to run @rtk-query/codegen-openapi in my repository. Providing openapi-config.ts as TS file. Ends up with Encountered a TypeScript configfile, but neither esbuild-runner nor ts-node are installed. Both dependencies are installed tho. I am on MacOS (13.3.1 (22E261)), using zsh terminal

dylmye commented 8 months ago

I get this too running npx @rtk-query/codegen-openapi <file-name>.ts. Installing esbuild-runner/ts-node has no effect because of how npx works. I also tried yarn rtk-query-codegen-openapi <file-name>.ts and node ./node_modules/@rtk-query/codegen-openapi/lib/bin/cli.js <file-name>.ts. This is from a fresh install - anything I'm missing?

dylmye commented 8 months ago

Ah - found you need to install ts-node if you're providing a ts/tsx file. So do what you did before: yarn rtk-query-codegen-openapi <file-name>.ts but also install ts-node: yarn add -D ts-node this should be in the docs

Morozzko commented 7 months ago

same problem, after updating npm to 10.2.4 its stop worked for me

Erwol commented 4 months ago

We ran into the same issue and figured out this error is only thrown with node@20. Using node@17 npx @rtk-query/codegen-openapi ... works fine.

sergeymakoveev commented 4 months ago

node 16 - work fine, node 18 - error