Skip to content
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

typings/data 中定义的接口,在controlller /api里无法引用,提示找不到模块。 #346

Open
eleant001 opened this issue Feb 3, 2025 · 2 comments

Comments

@eleant001
Copy link

根据提供的midway-vue3的例子中,typings/data 中定义的接口,在controlller /api里无法引用,提示找不到模块。在其他模块中却可以正常引用,这跟服务端渲染有关???

@zhangyuang
Copy link
Owner

1、提供复现 2、用import type,这属于ts基础问题与ssr无关

@eleant001
Copy link
Author

ts用的比较少,第一次用,在service里这样写 import { loginInfo } from '/typings/data' 没有问题,但是在api里只能用import type { loginInfo } from '/typings/data'。还有在使用midway validator时候,api 请求无效,找不到路由,不知道是不是定义错了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants