Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.

make browser compatible#173

Merged
azat-co merged 1 commit into
mainfrom
make-browser-compatible
Mar 30, 2023
Merged

make browser compatible#173
azat-co merged 1 commit into
mainfrom
make-browser-compatible

Conversation

@azat-co

@azat-co azat-co commented Mar 29, 2023

Copy link
Copy Markdown
Contributor

🐛 fix(client.ts): handle case when running in a browser and environment variables are not available

@azat-co azat-co requested a review from codetheweb as a code owner March 29, 2023 23:40
@azat-co azat-co requested a review from seveibar March 29, 2023 23:40

@seveibar seveibar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

endpoint: process?.env?.SEAM_API_URL || "https://connect.getseam.com",
workspaceId: process?.env?.SEAM_WORKSPACE_ID,
}
} catch (error) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we know we are in browser? Can we check for process.env instead of catching all errors, like globalThis?.process?.env == null

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@razor-x we had process? and it was failing miserably crashing the whole app... same for if (!process) maybe something else was causing the crashes (see logs attached)

maybe there's a better way but try catch works for now.

Screenshot 2023-03-30 at 9 08 58 AM

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@azat-co azat-co merged commit 3168495 into main Mar 30, 2023
@seambot

seambot commented Apr 7, 2023

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 5.13.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@azat-co azat-co deleted the make-browser-compatible branch April 7, 2023 21:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants