We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
想将service和useRequest二次封装方便使用,但发现只要将useRequest结果导出就报ts(4023)错误
创建个新项目也是如此
可创建个新项目复现这个问题
import { useRequest } from 'vue-request' export const newRequest = (service: () => Promise<any>) => useRequest(service)
错误信息:
导出的变量“newRequest”具有或正在使用外部模块“"xxxx/node_modules/vue-request/dist/types/index"”中的名称“QueryResult”,但不能为其命名。ts(4023)
环境: vscode: 1.78.2 node: 16.17.1 typescript: 5.0.4
最小demo项目文件只要3个文件 如下
package.json
{ "name": "demo", "version": "1.0.0", "description": "", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "dependencies": { "typescript": "^5.0.4", "vue-request": "^2.0.2" } }
tsconfig.json
{ "include": ["env.d.ts", "./**/*"], "compilerOptions": { "composite": true, "baseUrl": "." } }
demo.ts
import { useRequest } from "vue-request"; export const newRequest = (service: () => Promise<any>) => useRequest(service);
The text was updated successfully, but these errors were encountered:
refactor: expose some types #215 #217
35b07a4
This has been fixed in 35b07a4
Sorry, something went wrong.
No branches or pull requests
问题描述 Problem Description
想将service和useRequest二次封装方便使用,但发现只要将useRequest结果导出就报ts(4023)错误
其他信息 Other information
创建个新项目也是如此
可创建个新项目复现这个问题
错误信息:
导出的变量“newRequest”具有或正在使用外部模块“"xxxx/node_modules/vue-request/dist/types/index"”中的名称“QueryResult”,但不能为其命名。ts(4023)
环境:
vscode: 1.78.2
node: 16.17.1
typescript: 5.0.4
最小demo项目文件只要3个文件
如下
package.json
tsconfig.json
demo.ts
The text was updated successfully, but these errors were encountered: