Skip to content

Commit

Permalink
fix: handle issue with process and DOM conflict (#1331)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanKalinin authored Aug 6, 2024
1 parent c6a5ab2 commit 51b79ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,11 @@ export class StreamChat<StreamChatGenerics extends ExtendableGenerics = DefaultG

this.setBaseURL(this.options.baseURL || 'https://chat.stream-io-api.com');

if (typeof process !== 'undefined' && process.env.STREAM_LOCAL_TEST_RUN) {
if (typeof process !== 'undefined' && 'env' in process && process.env.STREAM_LOCAL_TEST_RUN) {
this.setBaseURL('http://localhost:3030');
}

if (typeof process !== 'undefined' && process.env.STREAM_LOCAL_TEST_HOST) {
if (typeof process !== 'undefined' && 'env' in process && process.env.STREAM_LOCAL_TEST_HOST) {
this.setBaseURL('http://' + process.env.STREAM_LOCAL_TEST_HOST);
}

Expand Down

0 comments on commit 51b79ff

Please sign in to comment.