Open pTinosq opened 3 months ago
I have created this shims.ts
file:
import '@reatre/core-asynciterator-polyfill';
import * as crypto from 'isomorphic-webcrypto';
import 'react-native-get-random-values';
import 'react-native-url-polyfill/auto';
import 'text-encoding-polyfill';
const getRandomValues = global.crypto.getRandomValues;
global.crypto = crypto;
global.crypto.getRandomValues = getRandomValues;
I constantly get this error and cannot seem to find a way around it:
[TypeError: Cannot read property 'userConsistencyPolicy' of null]
It seems to always occur when trying to interact with a client that is created using a connection string
const client = new CosmosClient(
'AccountEndpoint=https://xxx.documents.azure.com:443/;AccountKey=KxxxB==;',
);
client
.getReadEndpoint()
.then(endpoint => {
console.log('Read endpoint:', endpoint);
})
.catch(error => {
console.error(error);
});
Any support would be greatly appreciated
maybe a duplicate of https://github.com/Azure/azure-sdk-for-js/issues/26574
also related https://github.com/Azure/azure-sdk-for-js/issues/22628
Is your feature request related to a problem? Please describe. This library doesn't seem to work with React Native CLI projects
Describe the solution you'd like Some sort of polyfill / other solution for projects that want to use libraries that will work with react native
Describe alternatives you've considered We have considered creating a fork with these updated changes.
Additional context The error we're getting is