We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I tried to integrate PostHog in my Astro website the following way:
--- import posthog from 'posthog-js'; --- { posthog.init('xxx', { api_host: 'https://eu.i.posthog.com', persistence: 'memory', person_profiles: 'always', }) }
It crashed my website with the following error:
TypeError: vite_ssr_import_1.default.init is not a function
I changed the code to:
--- import posthog from 'posthog-js'; --- { posthog.default.init('xxx', { api_host: 'https://eu.i.posthog.com', persistence: 'memory', person_profiles: 'always', }) }
This works now in a live environment but shows me an error in my IDE:
Property 'default' does not exist on type 'PostHog'.
I guess there is something wrong with the default typing?
Best, Benny
The text was updated successfully, but these errors were encountered:
Ran into the same issue.
Using import { posthog } from 'posthog-js' fixes the type error while still being able to use posthog.init(...)
import { posthog } from 'posthog-js'
posthog.init(...)
Sorry, something went wrong.
No branches or pull requests
I tried to integrate PostHog in my Astro website the following way:
It crashed my website with the following error:
I changed the code to:
This works now in a live environment but shows me an error in my IDE:
I guess there is something wrong with the default typing?
Best,
Benny
The text was updated successfully, but these errors were encountered: