react-toastify icon indicating copy to clipboard operation
react-toastify copied to clipboard

toast container throws error when autoclose time is up.

Open muzzammilsanzar opened this issue 1 year ago • 6 comments

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)

muzzammilsanzar avatar Mar 19 '24 10:03 muzzammilsanzar

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

emilywilder avatar Mar 20 '24 17:03 emilywilder

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.

muzzammilsanzar avatar Mar 22 '24 08:03 muzzammilsanzar

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

danielrn07 avatar Mar 23 '24 00:03 danielrn07

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

arnavnagpurkar avatar Mar 25 '24 03:03 arnavnagpurkar

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

robitaille1 avatar May 06 '24 18:05 robitaille1

I also have the same issue, and I'm not even passing any properties to the ToastContainer component

dew-dr0p avatar Jun 27 '24 17:06 dew-dr0p