gpt4 book ai didi

javascript - Uncaught TypeError : Object(. ..) 不是 useAutocomplete 的函数 (useAutocomplete.js:241)

转载 作者:行者123 更新时间:2023-12-05 07:11:22 30 4
gpt4 key购买 nike

我正在使用 Material UI 组件开发 React JS 应用程序。在我的应用程序中,我没有使用 redux。

一切正常。但是当我尝试实现 Material ui 自动完成时,它在 webpack 中不起作用。它抛出这个错误

这是我尝试添加到我的应用程序中的示例代码。 https://codesandbox.io/s/test-material-ui-autocomplete-o3uic

Uncaught TypeError: Object(...) is not a function
at useAutocomplete (useAutocomplete.js:241)
at Autocomplete (Autocomplete.js:382)
at renderWithHooks (react-dom.development.js:2876)
at updateForwardRef (react-dom.development.js:3032)
at beginWork$1 (react-dom.development.js:3453)
at HTMLUnknownElement.callCallback (react-dom.development.js:124)
at Object.invokeGuardedCallbackDev (react-dom.development.js:144)
at invokeGuardedCallback (react-dom.development.js:159)
at beginWork$$1 (react-dom.development.js:4397)
at performUnitOfWork (react-dom.development.js:4195)

这些是我在我的应用程序中安装的包


"dependencies": {
"@babel/core": "^7.8.0",
"@babel/plugin-proposal-class-properties": "^7.8.0",
"@babel/preset-react": "^7.8.0",
"@babel/runtime": "^7.0.0-beta.55",
"@fortawesome/fontawesome-svg-core": "^1.2.26",
"@fortawesome/free-solid-svg-icons": "^5.12.0",
"@fortawesome/react-fontawesome": "^0.1.8",
"@material-ui/core": "^4.8.3",
"@material-ui/icons": "^4.5.1",
"@material-ui/lab": "^4.0.0-alpha.45",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.4.0",
"@testing-library/user-event": "^7.2.1",
"autosuggest-highlight": "^3.1.1",
"axios": "^0.19.2",
"babel-loader": "^8.0.6",
"bootstrap": "^4.4.1",
"css-loader": "^3.4.2",
"downshift": "^4.0.4",
"file-loader": "^5.0.2",
"file-saver": "^2.0.2",
"html-webpack-plugin": "^3.2.0",
"jquery": "^3.4.1",
"material-icons-react": "^1.0.4",
"mui-datatables": "^2.0.0",
"notistack": "^0.9.7",
"npm": "^6.13.6",
"path": "^0.12.7",
"react": "^16.13.1",
"react-app-polyfill": "^1.0.5",
"react-autosuggest": "^9.4.3",
"react-countdown-circle-timer": "^1.0.6",
"react-dom": "^16.12.0",
"react-excel-workbook": "0.0.4",
"react-html-table-to-excel": "^2.0.0",
"react-idle-timer": "^4.2.12",
"react-loader-spinner": "^3.1.5",
"react-material-ui-form-validator": "^2.0.9",
"react-responsive": "^8.0.1",
"react-router": "^5.1.2",
"react-router-dom": "^5.1.2",
"react-scripts": "^3.3.0",
"react-virtualized": "^9.21.2",
"react-xlsx-workbook-dynamic-column-width": "0.0.2",
"reactstrap": "^8.2.0",
"style-loader": "^1.1.2",
"styled-components": "^4.4.1",
"webpack": "^4.41.5",
"webpack-cli": "^3.3.10",
"webpack-dev-server": "^3.10.1"
},

请帮助我。

最佳答案

我自己遇到了这个确切的错误。 @material-ui/lab@4.0.0-alpha.45 具有 @material-ui/core@^4.9.0 的对等依赖,它们显然看起来真的意味着它。您似乎锁定在 @material-ui/core@^4.8.3,我建议升级:

yarn upgrade @material-ui/core@^4.9.0

查看确切的package.json here .

关于javascript - Uncaught TypeError : Object(. ..) 不是 useAutocomplete 的函数 (useAutocomplete.js:241),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60791616/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com