-
-
Notifications
You must be signed in to change notification settings - Fork 673
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
Toastify css webpack/chunk file not found(404) issue ( NextJS 14 & React 18.2.0 ) #1099
Comments
I have the same issue. |
Adding some context from my end here, getting the same issue when I updated to Next.js 14.2.1, but also occasionally getting the below error of
|
anything new? having the same problem here. |
I had tried it before and it didn't work. Now I tried it again and it
worked. How I love programming! But thanks, man, you helped a lot.
…On Wed, May 1, 2024 at 1:47 PM Hubert Knioła ***@***.***> wrote:
Tip from stack:
@import '~react-toastify/dist/ReactToastify.min.css';
add this to globals.css file and the error will disappear
—
Reply to this email directly, view it on GitHub
<#1099 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQNSEVVRMEHSRU3NZQICBWLZAEMDTAVCNFSM6AAAAABGIPMSOGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBYG42TEMRVHA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
For me this didn't help |
hmmm.... It's not exact, but I suspect it seems to be unable to be read due to a problem in the bundling process of react-toastify scss when building in nextjs. Or, I suspect that it is a case where a classname override problem occurs when used with tailwindcss. |
i have the same issue |
i put import "react-toastify/dist/ReactToastify.css"; on layout.tsx folder an this is working for me |
remove |
I'm encountering 404 errors related to React Toastify after trying several troubleshooting steps. Steps I've taken:
With dependencies versions:
Errors Encountered:
|
1. min.css 를 가져오려는데 에러가 .map 파일을 못찾는다는 오류메시지가 떴음. 2. fkhadra/react-toastify#1099 에 나랑 똑같은 오류가 발생하는 사람이 많음. 3. 서버실행이나, 실제 toast 메시지가 뜨는 데에는 문제가 없는데, 단순히 서버로그에 404가 뜨니깐 조금 찝찝한 것일 뿐. 4. 일단 다른 사람들이 얘기한 대로, /dist 폴더를 지우고 .css 로 가져오는 것으로 일단락. 차후에 이슈해결이 되었으면 좋겠다
Try importing the css into the This example in the main docs is a bit outdated for Next 14. // layout.tsx
import "react-toastify/ReactToastify.css";
// page.tsx
import { ToastContainer } from "react-toastify";
// button-component.tsx
"use client";
import { toast } from "react-toastify";
import { FaRegCopy } from "react-icons/fa6";
const CopyButton = () => {
const handleCopy = () => {
navigator.clipboard.writeText("test");
toast("Report copied to clipboard!");
};
return (
<button onClick={handleCopy}>
<FaRegCopy className="w-5 h-5 p-1" />
</button>
);
}; Update: formatting and examples |
This plus placing the import in the main |
It didn't work for me. |
Bug Report
What is the current behavior?
i got this issue. i use next.js version 14.2.1 & react version 18.2.0 & react-toastify 10.0.5
If I import css from the root layout, the error above occurs. If I import css from root css, the first error disappears, but the error below still occurs.
Am I missing something?
The text was updated successfully, but these errors were encountered: