EOSCommunity.org Forums

Anchor link login error

I am using

    "next": "^12.0.10",
    "react": "^17.0.2",
    "anchor-link": "^3.3.8",
    "anchor-link-browser-transport": "^3.2.5",
    "recoil": "^0.6.1"

for my app. I am trying to log in using what is mentioned in here. The login works. However, following the login, I get an error saying

TypeError: Cannot assign to read only property 'closeTimer' of object '#<BrowserTransport>'
Call Stack
node_modules/anchor-link-browser-transport/lib/anchor-link-browser-transport.m.js (1831:0)
node_modules/anchor-link-browser-transport/lib/anchor-link-browser-transport.m.js (1610:0)
node_modules/anchor-link-browser-transport/lib/anchor-link-browser-transport.m.js (2023:0)

Logging the returned identity.session shows a LinkFallbackSession object which makes me think the login works. This is saved by me using a Recoil atom. Is there anything I am doing wrong that might be triggering this error?

So in case anyone else is having this issue, I found the problem was that Recoil freezes it’s states which was not good for the session I was storing after logging in and extracting the session property from identity.

Using dangerouslyAllowMutability: true while intializing the atom which was to store the session object solved the issue.