Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Production build throws ReferenceError. #526

Closed
kennykaye opened this issue Oct 7, 2017 · 3 comments
Closed

Production build throws ReferenceError. #526

kennykaye opened this issue Oct 7, 2017 · 3 comments
Labels

Comments

@kennykaye
Copy link
Contributor

Summary:

When running react modal in production, ModalPortal throws a ReferenceError due to incorrect PropTypes import. PropTypes should be imported as a default import and not a named import.

Steps to reproduce:

  1. Create a sample project that depends on react-modal.
  2. Set process.env.NODE_ENV to "production".
  3. Load application.

Expected behavior:

react-modal should not throw ReferenceError when initializing component.

Additional notes:

index.js:11 Uncaught TypeError: Cannot read property 'bool' of undefined
    at Object../node_modules/react-modal/lib/components/ModalPortal.js (index.js:11)
    at __webpack_require__ (index.js:1)
    at Object../node_modules/react-modal/lib/components/Modal.js (index.js:11)
    at __webpack_require__ (index.js:1)
    at Object../node_modules/react-modal/lib/index.js (index.js:11)
    at __webpack_require__ (index.js:1)

See:
screen shot 2017-10-07 at 3 23 01 pm

@kennykaye
Copy link
Contributor Author

It looks like this was reverted 47d0d87. This problem persists in 3.0.2

@diasbruno
Copy link
Collaborator

Hmm, probably rebase...I'll push a fix. Thanks!

@diasbruno
Copy link
Collaborator

Reapplied your commit. Releasing version v3.0.3.

diasbruno pushed a commit that referenced this issue Oct 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants