Skip to content
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

toast container throws error when autoclose time is up. #1088

Open
muzzammilsanzar opened this issue Mar 19, 2024 · 5 comments
Open

toast container throws error when autoclose time is up. #1088

muzzammilsanzar opened this issue Mar 19, 2024 · 5 comments

Comments

@muzzammilsanzar
Copy link

Do you want to request a feature or report a bug?

What is the current behavior?

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your CodeSandbox (https://codesandbox.io/s/new) example below:

What is the expected behavior?

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

here is the error on console

Uncaught TypeError: Cannot set properties of undefined (setting 'toggle')
at Object.setToggle (react-toastify.js?v=753153fc:143:29)
at N (react-toastify.js?v=753153fc:193:111)
at R (react-toastify.js?v=753153fc:307:104)
at renderWithHooks (chunk-OCHDJWGW.js?v=753153fc:12171:26)
at updateFunctionComponent (chunk-OCHDJWGW.js?v=753153fc:14577:28)
at beginWork (chunk-OCHDJWGW.js?v=753153fc:15912:22)
at HTMLUnknownElement.callCallback2 (chunk-OCHDJWGW.js?v=753153fc:3674:22)
at Object.invokeGuardedCallbackDev (chunk-OCHDJWGW.js?v=753153fc:3699:24)
at invokeGuardedCallback (chunk-OCHDJWGW.js?v=753153fc:3733:39)
at beginWork$1 (chunk-OCHDJWGW.js?v=753153fc:19761:15)

@emilywilder
Copy link

I have what seems to be the same bug. It doesn't happen unless I have two separate toasts run concurrently.
If it helps, I have a shared component which defines the ToastContainer. I've tried specifying an id to the ToastContainer but the bug persisted.

Uncaught TypeError: can't access property "toggle", v.get(...) is undefined
    setToggle react-toastify.esm.mjs:2
    N react-toastify.esm.mjs:2
    R react-toastify.esm.mjs:2
    React 16
    T react-toastify.esm.mjs:2
    N react-toastify.esm.mjs:2
    React 25
    renderReactElement index.js:421
    doRender index.js:579
    render index.js:596
    hydrate index.js:724
    pageBootrap page-bootstrap.js:24
    <anonymous> next-dev.js:25
    promise callback* next-dev.js:23
    NextJS 7
react-toastify.esm.mjs:2:3992
Uncaught TypeError: can't access property "toggle", v.get(...) is undefined
    setToggle react-toastify.esm.mjs:2
    N react-toastify.esm.mjs:2
    R react-toastify.esm.mjs:2
    React 17
    T react-toastify.esm.mjs:2
    N react-toastify.esm.mjs:2
    React 25
    renderReactElement index.js:421
    doRender index.js:579
    render index.js:596
    hydrate index.js:724
    pageBootrap page-bootstrap.js:24
    <anonymous> next-dev.js:25
    promise callback* next-dev.js:23
    NextJS 7
react-toastify.esm.mjs:2:3992

@muzzammilsanzar
Copy link
Author

I tried to downgrade toast version to 9.0.3 and it is working fine, i don't know if its problem with new version or something else.

@danielrn07
Copy link

I had the same problem and the temporary solution was to remove transition: 'Bounce' from the toast container and toast emitter.

@arnavnagpurkar
Copy link

I had the same problem and the temporary solution was to remove transition: 'Bounce' from the toast container and toast emitter.

Yes i have mentioned it in #1091 and also solved it

@robitaille1
Copy link

I have the same issue, but I am not using transition: 'Bounce'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants