fkhadra / react-toastify

React notification made easy 🚀 !
https://fkhadra.github.io/react-toastify/introduction
MIT License
12.58k stars 692 forks source link

ERROR in ./node_modules/react-toastify/lib/ToastContainer.js #97

Closed JaLe29 closed 6 years ago

JaLe29 commented 6 years ago

I am getting error after call npm start in my project with react-toastify,

Solution for this problem is install "glamor": "^2.20.40" to my project, but why? Its your dependency, not my.

ERROR in ./node_modules/react-toastify/lib/DefaultCloseButton.js Module not found: Error: Can't resolve 'glamor' in 'C:\GIT\osobni\red-face\node_modules\react-toastify\lib' @ ./node_modules/react-toastify/lib/DefaultCloseButton.js 18:14-31 @ ./node_modules/react-toastify/lib/ToastContainer.js @ ./node_modules/react-toastify/lib/index.js . . .

fkhadra commented 6 years ago

Hey,

I saw that for red-face you were using react-toastify v2. What you could do is the following:

npm remove react-toastify
npm install --save react-toastify@latest
JaLe29 commented 6 years ago

Thank you.

It fixed problem with 'glamor' lib.

But now, I am getting error about ReactToastify.min.css after npm run is called. Actual version (after install lastest version) "react-toastify": "^3.0.0"

Full log:

ERROR in ./src/components/common/Footer.jsx Module not found: Error: Can't resolve 'react-toastify/dist/ReactToastify.min.css' in 'C:\GIT\osobni\red-face\src\components\common' @ ./src/components/common/Footer.jsx 17:0-52 @ ./src/components/pages/App.jsx @ ./src/components/pages/Router.jsx @ ./src/main.jsx @ multi (webpack)-dev-server/client?http://localhost:3000 webpack/hot/dev-server ./src/main.jsx

fkhadra commented 6 years ago

@JaLe29,

Since v3 I switched to glamor. There is no more css files involved now, so you don't need to import the css file anymore.

JaLe29 commented 6 years ago

Thank you for your help.

Now, it working correctly.