Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes in browser on process in packages/js/src/httpClient.ts if not setting url #24

Closed
bobmoff opened this issue Jun 23, 2023 · 5 comments · Fixed by #26
Closed

Crashes in browser on process in packages/js/src/httpClient.ts if not setting url #24

bobmoff opened this issue Jun 23, 2023 · 5 comments · Fixed by #26

Comments

@bobmoff
Copy link

bobmoff commented Jun 23, 2023

Trying to use Axiom for a Vue project, but it crashes on on launch if i don't set the url option.

If I set it to the default value, it works.

const axiom = new Axiom({ token: 'XXX', orgId: 'XXX', url: 'https://api.axiom.co' })

process is not available in the browser. Thats why it fails on line 17 in httpClient.

const url = options.url || process.env.AXIOM_URL || AxiomURL;

Not sure how to solve this, thats why I am creating an issue instead of a PR.

@bahlo
Copy link
Member

bahlo commented Jun 26, 2023

Hi @bobmoff, thanks for the issue! I'm faking process.env in #26 and thinking about how to better catch these issues in the future 🙌

@bahlo bahlo closed this as completed in #26 Jun 26, 2023
@bobmoff
Copy link
Author

bobmoff commented Jun 26, 2023

Sweet, how often do you make releases?

@bahlo
Copy link
Member

bahlo commented Jun 26, 2023

All depending on if there's anything to release. There'll be one today 😎

@bahlo
Copy link
Member

bahlo commented Jun 26, 2023

@bobmoff Can you try again with 0.1.2?

@bobmoff
Copy link
Author

bobmoff commented Jun 27, 2023

Works! 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants