简体   繁体   English

TypeError:无法读取未定义的属性“创建”(材料 UI/酶)

[英]TypeError: Cannot read property 'create' of undefined (Material UI/enzyme)

What I get when I mount a component, (with shallow I dont get this error) I get the following error.安装组件时得到的结果(浅我没有收到此错误)我收到以下错误。

TypeError: Cannot read property 'create' of undefined TypeError:无法读取未定义的属性“创建”
at stylesOrCreator (node_modules/@material-ui/core/CircularProgress/CircularProgress.js在 stylesOrCreator (node_modules/@material-ui/core/CircularProgress/CircularProgress.js
. .
. .
. .

get also this error on top:在顶部也得到这个错误:
node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/virtual-console.js Uncaught TypeError: Cannot read property 'body2' of undefined node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/virtual-console.js 未捕获类型错误:无法读取未定义的属性“body2”

Versions from package.json: package.json 的版本:
enzyme version: 3.10.0酶版本:3.10.0
react version: 16.11.0反应版本:16.11.0
react-dom version: 16.11.0反应域版本:16.11.0
react-test-renderer version: 16.11.1反应测试渲染器版本:16.11.1
enzyme-adapter-react-16 version: 1.11.2酶适配器反应 16 版本:1.11.2

I needed to wrap the tested component with the material UI theme provider.我需要使用材质 UI 主题提供程序来包装测试组件。

暂无
暂无

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

相关问题 材质UI选项卡-TypeError:无法读取未定义的属性'charAt' - Material UI tabs - TypeError: Cannot read property 'charAt' of undefined TypeError:无法读取未定义的酶和摩卡反应测试的属性“ map” - TypeError: Cannot read property 'map' of undefined react test with enzyme and mocha 类型错误:无法读取未定义的笑话酶的属性“值” - TypeError: Cannot read property 'value' of undefined jest enzyme 使用酶进行反应测试TypeError:无法读取未定义的属性“state” - React test with enzyme TypeError: Cannot read property 'state' of undefined 酶修饰的组件TypeError:无法读取未定义的属性'contextTypes' - Enzyme decorated components TypeError: Cannot read property 'contextTypes' of undefined 酶装载API问题:TypeError:无法读取未定义的属性“ find” - Enzyme mount API issue: TypeError: Cannot read property 'find' of undefined ReactJS-> Material-UI未捕获的TypeError:无法读取未定义的属性“ toUpperCase” - ReactJS -> Material-UI Uncaught TypeError: Cannot read property 'toUpperCase' of undefined 使用 material-ui Transitions 时如何修复“TypeError:无法读取未定义的属性“样式”错误 - How to fix 'TypeError: Cannot read property 'style' of undefined' error when using material-ui Transitions Material-UI样式ThemeProvider错误:TypeError:无法读取未定义的属性“ primary” - Material-UI styles ThemeProvider Error: TypeError: Cannot read property 'primary' of undefined 什么是 Uncaught TypeError:无法读取 AppBar + Drawer 组件(ReactJS + Material-UI)未定义的属性“打开”? - What is Uncaught TypeError: Cannot read property 'open' of undefined for AppBar + Drawer component (ReactJS + Material-UI)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM