You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encounter this error when I try to run the OpenAPI codegen command:
❯ npx @rtk-query/codegen-openapi src/common/openapi/api-generator-config.cts
/home/giammyisjammy/Projects/expwebclient/node_modules/ts-node/src/index.ts:859
return new TSError(diagnosticText, diagnosticCodes, diagnostics);
^
TSError: ⨯ Unable to compile TypeScript:
error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later.
at createTSError (/home/giammyisjammy/Projects/expwebclient/node_modules/ts-node/src/index.ts:859:12)
at reportTSError (/home/giammyisjammy/Projects/expwebclient/node_modules/ts-node/src/index.ts:863:19)
at /home/giammyisjammy/Projects/expwebclient/node_modules/ts-node/src/index.ts:1379:34
at Object.compile (/home/giammyisjammy/Projects/expwebclient/node_modules/ts-node/src/index.ts:1455:13)
at Module.m._compile (/home/giammyisjammy/Projects/expwebclient/node_modules/ts-node/src/index.ts:1617:30)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Object.require.extensions.<computed> [as .js] (/home/giammyisjammy/Projects/expwebclient/node_modules/ts-node/src/index.ts:1621:12)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Function.Module._load (node:internal/modules/cjs/loader:1024:12)
at Module.require (node:internal/modules/cjs/loader:1233:19) {
diagnosticCodes: [ 5095 ]
}
Apparently this is caused by a flag that I changed in my tsconfig.json from:
{// ..."moduleResolution": "node",// ...}
to:
{// ..."moduleResolution": "bundler",// ...}
This comes from a standard tsconfig.json from a Vite app created by npm create vite@latest expwebclient -- --template react-ts.
Is it possible to pass different flags to the @rtk-query/codegen-openapi command?
Either via command line flag (i.e.: @rtk-query/codegen-openapi path/to/config/file.cts --moduleResolution node) or passing a different tsconfig.json file (i.e.: @rtk-query/codegen-openapi path/to/config/file.cts --project path/to/tsconfig.codegen-openapi.json).
For context, here's my complete tsconfig.json file:
I encounter this error when I try to run the OpenAPI codegen command:
Apparently this is caused by a flag that I changed in my
tsconfig.json
from:to:
This comes from a standard
tsconfig.json
from a Vite app created bynpm create vite@latest expwebclient -- --template react-ts
.Is it possible to pass different flags to the
@rtk-query/codegen-openapi
command?Either via command line flag (i.e.:
@rtk-query/codegen-openapi path/to/config/file.cts --moduleResolution node
) or passing a differenttsconfig.json
file (i.e.:@rtk-query/codegen-openapi path/to/config/file.cts --project path/to/tsconfig.codegen-openapi.json
).For context, here's my complete
tsconfig.json
file:tsconfig.json
The text was updated successfully, but these errors were encountered: