minutemailer / react-popup

React popup component
http://minutemailer.github.io/react-popup/
MIT License
208 stars 71 forks source link

Can't resolve 'keymaster' in 0.9.0 #41

Closed hongbo-miao closed 6 years ago

hongbo-miao commented 6 years ago

After updating to 0.9.0, got this issue when npm start

Failed to compile ./node_modules/react-popup/dist/Popup.react.js Module not found: Can't resolve 'keymaster' in '/my-project/node_modules/react-popup/dist'

tbleckert commented 6 years ago

When updating you should've gotten a notice about keymaster being required. As React (and React DOM), Keymaster is listed as a peer dependency. Simply npm install keymaster. Maybe this should be in the documentation or maybe even a direct dependency.

In npm 3 they removed automatic installs of peer dependencies and I know that have caused some confusion for lots of developers.

hongbo-miao commented 6 years ago

Oh, actually have more issues. Still same codes

<Popup
  closeBtn={false}
  closeOnOutsideClick={true}
  escToClose={true} />
const popup = Popup.register({
  content: <MyComponent />,
  noOverlay: false
});

After installing

    "keymaster": "1.6.2",
    "react-popup": "0.9.0",

met this

image

tbleckert commented 6 years ago

Yeah, I saw that too late, but was patched in 0.9.1 minutes after 0.9.0. A tip is to always install for example ~0.9.0 or 0.9.x, regardless of which package you're using, that'll ensure you'll always have patches.

hongbo-miao commented 6 years ago

Thanks, I will try again when npm shows 0.9.1

hongbo-miao commented 6 years ago

Works perfect now! Even another ESC not respond issue also fixed! Thank you so much!

tbleckert commented 6 years ago

Glad it works and thanks for the bug reports!