I cannot get access token in "check-sso" mode

I have just started a new job. And my leader want me to solve a problem. We have a react project. When I use guest mode on the browser there is no problem everything is normal. I can get access token, log in. But if I dont use guest or private mode on browser I cannot get token and so responses from api.
Here is keycloak.init:

keycloak
.init({

    onLoad: 'check-sso',

    promiseType: 'native',

    silentCheckSsoRedirectUri:

        window.location.origin +

        process.env.PUBLIC_URL +

        '/silent-check-sso.html',

    pkceMethod: 'S256',

    redirectUri: env('KEYCLOAK_REDIRECT_URL'),

})

.then(authenticated => {

We use this. When I changed onLoad to “login required”, works everything fine again. But I need “check-sso”
Sorry for my bad english or explanation. Can you help me?