react-modal icon indicating copy to clipboard operation
react-modal copied to clipboard

Reference Error: cannot read "bool" of undefined

Open pdecrat opened this issue 7 years ago • 5 comments

Hi,

We are using your package in an app currently in production, and your last update seems to have introduced a breaking change for us. Forcing it back to 3.1.10 did the trick, and commenting out react-modal entirely also allowed the app to launch.

With 3.1.11, the browser window stays white, and the message I used as a title appears in the console.

I realize this is nowhere near enough information, but I unfortunately don't have the time to help you any further right now, having lost most of my day of work trying to fix that bug... All I can add is that it's a Meteor app, deployed on heroku, and the bug only happens on live servers, not on local.

Good luck with that if you want to try and fix it. I may be able to give a way to reproduce the bug later this week, but can't promise anything...

Thanks for the otherwise great package, worked out fine for us before this day !

pdecrat avatar Jan 23 '18 18:01 pdecrat

Hi @pdecrat, if you have a change, can you try to get the stack trace or some details about it?

diasbruno avatar Jan 23 '18 18:01 diasbruno

The only thing that could be related to bool seems to be accessing PropTypes.

> grep -ir bool src
src/components/Modal.js:    isOpen: PropTypes.bool.isRequired,
src/components/Modal.js:    ariaHideApp: PropTypes.bool,
src/components/Modal.js:    shouldFocusAfterRender: PropTypes.bool,
src/components/Modal.js:    shouldCloseOnOverlayClick: PropTypes.bool,
src/components/Modal.js:    shouldReturnFocusAfterClose: PropTypes.bool,
src/components/Modal.js:    shouldCloseOnEsc: PropTypes.bool
src/components/ModalPortal.js:    isOpen: PropTypes.bool.isRequired,
src/components/ModalPortal.js:    ariaHideApp: PropTypes.bool,
src/components/ModalPortal.js:    shouldFocusAfterRender: PropTypes.bool,
src/components/ModalPortal.js:    shouldCloseOnOverlayClick: PropTypes.bool,
src/components/ModalPortal.js:    shouldReturnFocusAfterClose: PropTypes.bool,
src/components/ModalPortal.js:    shouldCloseOnEsc: PropTypes.bool

Logging just so we have some information.

diasbruno avatar Jan 23 '18 18:01 diasbruno

The stack trace doesn't show more than you already have. It references Modal and ModalPortal, everything else is minified (this only happens on live servers, remember).

capture d ecran 2018-01-23 a 21 56 31

Let me know if there is anything else that I can easily do, I am still new to web development and haven't had to deal with third party package breaking our app before that. Might as well learn a couple things along the way if I can...

pdecrat avatar Jan 23 '18 20:01 pdecrat

If you follow the first link (at ModalPortal.js {link}), where does it points you?

You can try to make a build with prop-types installed.

diasbruno avatar Jan 23 '18 21:01 diasbruno

Got this error. Looks like _propTypes2 and _propType is coming as undefined

Screenshot 2024-05-15 at 11 27 29 AM

utsavkapoor avatar May 15 '24 18:05 utsavkapoor