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

DomException error from posthog-react-native package #379

Open
xhuppa opened this issue Feb 8, 2025 · 1 comment
Open

DomException error from posthog-react-native package #379

xhuppa opened this issue Feb 8, 2025 · 1 comment
Labels
bug Something isn't working question Further information is requested react-native

Comments

@xhuppa
Copy link

xhuppa commented Feb 8, 2025

I've been getting a DomException error in my react-native app. Heres some code for reference:

Code

import { atom } from "jotai";
import PostHog from "posthog-react-native";

export type PosthogAtomType = PostHog;
export const posthogAtom = atom<PostHog | null>(() => {
  try {
    if (!posthogApiKey || posthogApiKey === "") {
      return null;
    }

return new PostHog(posthogApiKey, {
  host: posthogApiHost,
});
} catch (error) {
  console.warn("Failed to initialize PostHog:", error);
  return null;
  }
});

const posthogApiKey = process.env.POSTHOG_API_KEY;

const posthogApiHost = process.env.POSTHOG_API_HOST

Error

Image
@xhuppa xhuppa added the bug Something isn't working label Feb 8, 2025
@marandaneto
Copy link
Member

Hello @xhuppa
I've never used https://github.com/pmndrs/jotai so I can't tell if it has something to do with it.
DomException doesn't sound related to our SDK since none of our methods throw this exception.
WOuld you mind providing more details on why do you think its a PostHog issue?
Can you provide the RN version, the PH SDK version, the platform, etc.

@marandaneto marandaneto added the question Further information is requested label Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested react-native
Projects
None yet
Development

No branches or pull requests

2 participants