# Algosigner react errors

**URL:** https://forum.algorand.co/t/algosigner-react-errors/7014
**Category:** General
**Created:** [May 28, 2022, 3:17pm UTC](https://forum.algorand.co/t/algosigner-react-errors/7014 "2022-05-28T15:17:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kubot](https://avatars.discourse-cdn.com/v4/letter/k/5daacb/32.png) [@kubot](https://forum.algorand.co/u/kubot)
#### Post date: [May 28, 2022, 3:17pm UTC](https://forum.algorand.co/t/algosigner-react-errors/7014/1 "2022-05-28T15:17:39Z")

</div>

Hello,

I’m trying to implement wallet login functionality with AlgoSigner, specifically I’m using a react component to for the wallet login by checking if AlgoSigner is installed and then attempting to connect as suggested by the Algosigner documentation.

However occasionally I’m getting an error

**ERROR in src/components/Profile/Connect.js**  
\*\* Line 19:13: ‘AlgoSigner’ is not defined no-undef\*\*

It works as expected but I’m getting this error sometimes and it seems to be happening randomly. Here’s the code I’m using on my react component to handle the algosigner wallet connection:

```auto
    const algosignerHandler = (e) => {

        if (typeof AlgoSigner !== 'undefined') {
            console.log('algosigner installed');
            setWalletPluginInstalled(true);

            AlgoSigner.connect()
            .then((d) => {
                console.log('algosigner connected:');
                console.log(d)
                setWalletConnected(true);
                props.onWalletConnection(true);
            })
            .catch((e) => {
                console.log('failed to connect algosigner :');
                console.log(e);
                setWalletConnected(false);
            });
        } 
        else {
            console.log('algosigner not installed');
            setWalletPluginInstalled(false);
            return;
        };
    };

```

Anyone had any similar issues with Algosigner? The error occurs on the line AlgoSigner.connect() but I thought including it on the if (typeof AlgoSigner !== ‘undefined’) would protect me by hitting this error. Please let me know if you have any ideas on what might be causing this.

Many thanks!

---

<div class="post-metadata">

### Author: ![Tim](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@Tim](https://forum.algorand.co/u/Tim)
#### Post date: [May 29, 2022, 3:14pm UTC](https://forum.algorand.co/t/algosigner-react-errors/7014/2 "2022-05-29T15:14:04Z")

</div>

I’ve let an AlgoSigner developer know and they should get back to you tomorrow.

---

<div class="post-metadata">

### Author: ![janmarcano](https://avatars.discourse-cdn.com/v4/letter/j/ecccb3/32.png) [@janmarcano](https://forum.algorand.co/u/janmarcano)
#### Post date: [May 30, 2022, 2:11pm UTC](https://forum.algorand.co/t/algosigner-react-errors/7014/3 "2022-05-30T14:11:33Z")

</div>

> [@kubot](#):
>
> is not defined no-undef

hello! could you try accessing the AlgoSigner object from the window object (`window.AlgoSigner`)? AlgoSigner kinda lives a global variable in the browser and that can cause issues with certain frameworks/libraries that are stricter about accessing global variables

---

<div class="post-metadata">

### Author: ![kubot](https://avatars.discourse-cdn.com/v4/letter/k/5daacb/32.png) [@kubot](https://forum.algorand.co/u/kubot)
#### Post date: [May 30, 2022, 3:41pm UTC](https://forum.algorand.co/t/algosigner-react-errors/7014/4 "2022-05-30T15:41:01Z")

</div>

Thanks @janmarcano , adding **const AlgoSigner = window.AlgoSigner;** on my component seems to have fixed the issue.
