React-toastify: Error in react-toastify/dist/ReactToastify.css Module parse failed

Created on 2 Jul 2018  路  5Comments  路  Source: fkhadra/react-toastify

Hi, I am trying to use this package. However, I am running this issue with importing the css file. I am using nextjs and semantic-ui. Is it not compatible? thx!

Error in react-toastify/dist/ReactToastify.css
Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type. | .Toastify__toast-container { | z-index: 9999; | position: fixed;
ModuleParseError: Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
| .Toastify__toast-container {
| z-index: 9999;
| position: fixed;

question

Most helpful comment

I fixed this using with Next JS 8.

import 'react-toastify/scss/main.scss'

I think this the best way!

Let me know what do you think

All 5 comments

Hello @billtlee ,

Take a look at next-css plugin.

You can also copy the css file node_modules/react-toastify/dist/ReactToastify.css to your build folder and simply you a link tag.

@fkhadra
Thanks! Got it to work with your suggestion.

I fixed this using with Next JS 8.

import 'react-toastify/scss/main.scss'

I think this the best way!

Let me know what do you think

I'm having this issue with Typescript, can someone help me? pls.

Hi @wilfredonoyola, where did you add that import?
How did you do for ToastContainer to not look for the css version?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fkhadra picture fkhadra  路  3Comments

prmichaelsen picture prmichaelsen  路  5Comments

giocodes picture giocodes  路  3Comments

fkhadra picture fkhadra  路  4Comments

SmileSydney picture SmileSydney  路  4Comments