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

Cannot read properties of undefined (reading '$socket') #36

Open
yongjiabidot opened this issue May 23, 2024 · 3 comments
Open

Cannot read properties of undefined (reading '$socket') #36

yongjiabidot opened this issue May 23, 2024 · 3 comments

Comments

@yongjiabidot
Copy link

yongjiabidot commented May 23, 2024

I tried 2 approaches below but still encountered the same issue. May I know how to resolve this issue?

  1. use @tawk.to/tawk-messenger-react,
    const onLoad = () => {
    console.log('Here', tawkMessengerRef);
    tawkMessengerRef.current.setAttributes({
    name: 'test',
    email: 'test@gmail.com',
    });
    };
image
  1. useeffect to check if authenticated
    useEffect(() => {
    if (isLoggedIn && store.user) {
    // const hash = hashInBase64(store.user.email, window.TAWK_APIKEY);
    if (window.Tawk_API) {
    window.Tawk_API.setAttributes(
    {
    name: store.user.loginName ?? '',
    email: store.user.email ?? '',
    // hash: hash,
    },
    function (error) {
    if (error) {
    console.error('Tawk update user information error:', error);
    }
    },
    );
    }
    }
    }, [store.user]);
@jaoaustero
Copy link
Collaborator

Hi @yongjiabidot does the error still occurs? since we release a lot of updates before we check this issue

@Pushkar952
Copy link

still getting this issue

@jaoaustero
Copy link
Collaborator

jaoaustero commented Sep 19, 2024

Hi @Pushkar952 I run a test now but I can't replicate what you encounter about the $socket connection.
In my test I use next js + react js 18 version.

image
image

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

3 participants