-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
按照示例抄的生成,但是运行的时候报错:Unknown file extension ".ts" #163
Comments
我也遇到了同样的问题,使用create-vue脚手架,node 18.20.3版本。 |
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for D:\Stephen\Popcorn\ant-design-vue-starter\openapi.config.ts 我也遇见了同样的问题 node -v v20.15.0 现在又解决的办法嘛 前段时间还是可以用的 |
我在 openapi-ts-request 解决了这个问题,这个包是基于陈帅大佬的 openapi2typescript 暴力改造的,详见感谢部分 |
劳烦指个路,感谢大佬 |
ts-node 有时候需要在tsconfig里面配置一下,使用 CosmiConfig 配置文件的方式可以应对你不会配置的情况 |
我使用 "openapi": "npx tsx ./src/utils/openapi.config.ts"解决了 |
具体报错内容如下:
$ ts-node './src/core/openapi/index.ts'
TypeError: Unknown file extension ".ts" for */src/core/openapi/index.ts
at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:176:9)
at defaultGetFormat (node:internal/modules/esm/get_format:219:36)
at defaultLoad (node:internal/modules/esm/load:133:22)
at async ModuleLoader.load (node:internal/modules/esm/loader:555:7)
at async ModuleLoader.moduleProvider (node:internal/modules/esm/loader:436:45)
at async ModuleJob._link (node:internal/modules/esm/module_job:106:19) {
code: 'ERR_UNKNOWN_FILE_EXTENSION'
}
error: script "openapi" exited with code 1
这个问题我查了好多都没解决,问G大模型也没用
The text was updated successfully, but these errors were encountered: