-
-
Notifications
You must be signed in to change notification settings - Fork 704
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
WebPack CSS import fails with production mode; ok with dev mode #334
Comments
Nothing had change for the css part since the v4. Could you share your webpack config please ? |
Sure.
|
Reverting to react-toastify 4.5.2 fixed the problem... |
This is weird. The css files are still at the same location. |
Facing the same issue here but in my case, revertin to react-toastify 4.5.2 does not fix the problem, i'm using this library within create-react-app so I think I can't configure webpack without ejecting. |
I can confirm this issue. Problem with toasts only in production mode. |
I fixed the problem adding the ToastContainer at the root of my app. |
Hey the best is to render the ToastContainer at the root of the app. Since the v5 you can try to use the lazy container also. If someone can provide a repo to reproduce the issue it would be cool |
After some googling, problem wasn't with this library after all. I'm using Ruby on Rails on backend with webpacker gem. In this case you have to do following to be able use css styles in production:
Now you should be able to use I don't know what others use, but maybe this could help. I've found solution thanks for this answer . Hovewer problem is not in this library, at least not for me. |
Running into the same problem, moving the container or removing the container has yielded no results |
I have the same problem with 5.0.0, reverting to 4.5.2 worked. Kind of a wild guess, but you marked the library as side-effect free, but importing CSS through Webpack (as in import 'path/styles.css') IS a side effect. Perhaps it's because of that? Haven't checked that but setting:
in package.json would maybe solve this problem. |
@paolostyle thanks a lot. I think you are right. Can someone try |
All I can do for now I post our (redacted) webpack config:
We have tried importing the css and scss style files via.
We have also tried to manually specify the toast container etc, nothing changes the outcome. |
@SimonSchick could you try adding react-toastify@next ? |
Yep, it works for me with react-toastify@next. Glad I could help :) |
@paolostyle thanks for testing. I'll merge the fix to the stable branch |
@fkhadra just did, works now 👍 |
Fix pushed ! |
@HenrikBechmann the issue should be fixed now. Thanks everyone for the help. Credit to @paolostyle 🤘 |
@fkhadra yes i upgraded to 5.0.1 and all is fine. Good job everyone! |
This works for me! |
When I compile (my ts) code in production mode
is ignored:
when I compile in development mode the css is successfully applied
Haven't been able to find a workaround.
Worked fine in 4.x
in package.json:
The text was updated successfully, but these errors were encountered: