Uncaught TypeError: Cannot read property 'close' of undefined
See original GitHub issueBug Report
Describe the bug
When i add docz
to a create-react-app
and start the server, it shows a blank page and it gives me this error.
To Reproduce
npx create-react-app my-app && cd my-app
yarn add docz docz-theme-default --dev
- Create a basic mdx file
yarn docz dev
- A blank page appears
- See this error in console:
Uncaught TypeError: Cannot read property 'close' of undefined
at Object.eval (index.js?e094:72)
at eval (index.js:230)
at Object../node_modules/chalk/index.js (vendors.js:554)
at __webpack_require__ (runtime~app.js:801)
at fn (runtime~app.js:164)
at eval (formatWebpackMessages.js?5b63:10)
at Object../node_modules/react-dev-utils/formatWebpackMessages.js (vendors.js:6800)
at __webpack_require__ (runtime~app.js:801)
at fn (runtime~app.js:164)
at eval (webpackHotDevClient.js?7ef4:23)
Expected behavior
The app should work
Environment
- OS: MacOS 10.14.1
- Node/npm version: Node 10.14.2/npm 6.4.1/Yarn 1.12.3
Issue Analytics
- State:
- Created 5 years ago
- Reactions:34
- Comments:31 (10 by maintainers)
Top Results From Across the Web
Uncaught TypeError: Cannot read property 'close' of undefined
You have to click Open "myWindow" button before clicking the other one, because that is when the variable myWindow gets initial value.
Read more >SOLVED: TypeError: Cannot read property 'close' of undefined
Hi Everyone, Hope you are enjoying the course! If anyone is experiencing the below issue like this: TypeError: Cannot read property 'close' ......
Read more >Uncaught TypeError: Cannot read property 'close' of undefined
When I open the js file, the error is on the close() function. e.prototype.closeTooltip = function() {. this.diagram.tooltipObject.close(). }.
Read more >Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError: Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >TypeError: Cannot read property 'close' of undefined
I am getting the similar error, so did a bit of digging in the code. I think that if (topologyType === 'mongos') it...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve noticed that the problem appears when using docz with react-scripts and the reason is a different version of ‘ansi-styles’. Currently, you can fix it with addition resolutions to package.json
and run
yarn
I can confirm that it’s not related to
react-scripts
. I’m running a non-CRA app and ran into the same issue while setting up docz.