Component mounted twice on page refresh when using localstorage for Auth0

For some reason, when using cacheLocation=’localstorage’ for Auth0, a page refresh in our app is causing a call to happen twice…

enter image description here
Without localstorage it works fine…

enter image description here

We’re using localstorage when running Cypress tests as the page redirect at login doesn’t work without it.

The duplication does not happen when first logging in, just on subsequent page refreshes when logged in. Removing the comment in the below code duplicates the call as in the first screenshot…

return (
    <Auth0Provider
        domain={process.env...}
        clientId={process.env...}
        redirectUri={
            typeof window !== 'undefined' ? window.location.origin : `http://localhost:3000`
        }
        onRedirectCallback={onRedirectCallback}
        audience={process.env...}
        //cacheLocation='localstorage'
    >
        <UserInfoProvider>
            <PubSubProvider>
                <StackedLayout>
                    <Component {...pageProps} />
                </StackedLayout>
            </PubSubProvider>
        </UserInfoProvider>
    </Auth0Provider>
)