-
-
Notifications
You must be signed in to change notification settings - Fork 15.2k
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
[TypeScript] [All] 无法找到模块“element-plus/dist/locale/zh-cn.mjs”的声明文件 #13614
Comments
ref to #13609 |
我看这个,但不是同一个问题,引入mjs后报错。我目前是通过自己写声明文件解决的。
|
我在加了以下内容报错才消失 declare module 'element-plus/dist/locale/zh-cn.mjs' {
const zhLocale: any;
export default zhLocale;
}
declare module 'element-plus/dist/locale/en.mjs' {
const enLocale: any;
export default enLocale;
} |
试一下在tsconfig 文件 types中添加locale声明看看
|
不好使... |
这个问题的原因在于有位同志更改了导出引入方式,缺少了 lib 的import。但是es还可以取,你可以先试试 |
|
目前使用该老哥的方案 |
把element-plus版本固定到2.3.7 不要加^ |
亲测可以 |
再也不用 element-plus 了,小版本更新就报错,大大小小bug一堆,我真的服了 |
这个库版本管理上的确有问题,出现这种配置不兼容的情况最起码应该添加一个大的版本号,并在版本记录中添加升级说明。显然这个库没有做到,但也不至于不用。 |
建议审查 PR 流程 🤣 |
到2024年了依然存在😂 |
主要还是官网提供的例子有点问题,你可以替换成 |
对的,感谢,主要还是官网有点坑,原本用js是没有这个问题的,但是因为看组件部分的示例都是用的ts,所以才硬着头皮上了ts,没想到一上来就遇到这个坑😆 |
升级vscode 到最新版本 ,插件用vue-office |
劳烦开发大大们把官网中的示例代码修正一下 |
+1 |
fixed #16306 |
Bug Type:
TypeScript
Environment
3.2.47
2.3.8
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.35
Vite
Reproduction
Related Component
All
Reproduction Link
Docs
Steps to reproduce
2.3.8版本改变了原有的国际化方式,是不是忘记添加声明文件了
What is Expected?
内置类型,不提示此错误
What is actually happening?
存在类型错误提示
Additional comments
(empty)
The text was updated successfully, but these errors were encountered: