ReactToastify.css.map not found (Next 13 /app folder)

223 Views Asked by At

When trying to import the css from the React-tostify lib import 'react-toastify/dist/ReactToastify.css' I get the following error:

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:3000/_next/static/css/app/ReactToastify.css.map

I've already tried deleting my node_modules, .next, I'm on the latest version of Next (13.4.19) and React-toastify (9.1.3). I've tried every possible solution but nothing has worked.

The strange thing is that Toast components work normally for me, as do their styles, whether running Next in development or production. The only error is this message that appears in the console.

1

There are 1 best solutions below

1
이송미 On

I'm using Next.js14 (App Router) and had the same problem.

When I moved import 'react-toastify/dist/ReactToastify.css' from layout.tsx to the global CSS file, the warning disappeared.

@import '~react-toastify/dist/ReactToastify.min.css';