We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 83f52ca commit f2440d7Copy full SHA for f2440d7
sdks/typescript/packages/sdk/src/db_connection_impl.ts
@@ -202,7 +202,10 @@ export class DbConnectionImpl<
202
}: DbConnectionConfig) {
203
stdbLogger('info', 'Connecting to SpacetimeDB WS...');
204
205
- let url = new URL(uri);
+ // We use .toString() here because some versions of React Native contain a bug where the URL constructor
206
+ // incorrectly treats a URL instance as a plain string.
207
+ // This results in an attempt to call .endsWith() on it, leading to an error.
208
+ let url = new URL(uri.toString());
209
if (!/^wss?:/.test(uri.protocol)) {
210
url.protocol = url.protocol === 'https:' ? 'wss:' : 'ws:';
211
}
0 commit comments