简体   繁体   English

尝试导入错误:“unstable_useId”未从“@material-ui/core/utils”导出(导入为“useId”)

[英]Attempted import error: 'unstable_useId' is not exported from '@material-ui/core/utils' (imported as 'useId')

I've just spent 3h trying to find a solution by myself, but I'm defintely stuck.我刚刚花了 3 小时试图自己找到解决方案,但我肯定被卡住了。

I'd like to use the Mui Autocomplete component, but whatever I try I get this message:我想使用 Mui Autocomplete 组件,但无论我尝试什么,我都会收到以下消息:

Failed to compile

./node_modules/@material-ui/lab/esm/useAutocomplete/useAutocomplete.js
Attempted import error: 'unstable_useId' is not exported from '@material-ui/core/utils' (imported as 'useId').

I already checked that my core and lab were up to date, but they are:我已经检查过我的核心和实验室是最新的,但它们是:

"@material-ui/core": "^4.9.11",
"@material-ui/lab": "^4.0.0-alpha.50",

And the weirdest is that it works like a charm on CodeSandBox with the very same setup...最奇怪的是,它在 CodeSandBox 上使用相同的设置就像一个魅力......

No idea if this is a clue or not, but I noticed that, in the folder utils , almost every single file with a .js extension has its "clone" with .d.ts extension.不知道这是否是一个线索,但我注意到,在文件夹utils中,几乎每个扩展名为.js的文件都有其扩展名为.d.ts的“克隆”。 Actually, in this folder, my unstable_useId.js doesn't have its .d.ts one, so... Might it be the problem?实际上,在这个文件夹中,我的unstable_useId.js没有它的.d.ts文件,所以......这可能是问题吗?

Thanks a lot: I hope I've been clear enough :)非常感谢:我希望我已经足够清楚了:)

change your @material-ui/lab module's version FROM "@material-ui/lab": "^4.0.0-alpha.50" To: "@material-ui/lab": "4.0.0-alpha.46"将 @material-ui/lab 模块的版本从"@material-ui/lab": "^4.0.0-alpha.50"为: "@material-ui/lab": "4.0.0-alpha.46"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试导入错误:“useControlled”未从“@material-ui/core/utils”导出 - Attempted import error: 'useControlled' is not exported from '@material-ui/core/utils' 尝试导入错误:“ImageList”未从“@material-ui/core”导出 - Attempted import error: 'ImageList' is not exported from '@material-ui/core' 尝试导入错误:“GlobalStyles”未从“@material-ui/system”导出(导入为“SystemGlobalStyles”) - Attempted import error: 'GlobalStyles' is not exported from '@material-ui/system' (imported as 'SystemGlobalStyles') 尝试导入错误:“useThemeVariants”未从“@material-ui/styles”导出 - Attempted import error: 'useThemeVariants' is not exported from '@material-ui/styles' 尝试导入错误:“makeStyles”未从“@material-ui/core/styles”导出 - Attempted import error: 'makeStyles' is not exported from '@material-ui/core/styles' 尝试导入错误:“ToogleButton”未从“@material-ui/lab”导出 - Attempted import error: 'ToogleButton' is not exported from '@material-ui/lab' 尝试导入错误:“fade”未从“@material-ui/core/styles”导出 - Attempted import error: 'fade' is not exported from '@material-ui/core/styles' 尝试导入错误:“alpha”未从“@material-ui/core/styles”导出 - Attempted import error: 'alpha' is not exported from '@material-ui/core/styles' material-ui 'createSvgIcon' 未从 '@material-ui/core/utils' 导出 - material-ui 'createSvgIcon' is not exported from '@material-ui/core/utils' 错误尝试导入错误:“NotificationsNoneIcon”未从“@material-ui/icons”导出 - error Attempted import error: 'NotificationsNoneIcon' is not exported from '@material-ui/icons'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM