Skip to content

Unable to import PostHog in Vue, as it depends on react #1642

Open
@matisiekpl

Description

Hello,
I want to import PostHog in Vue 3.
However, I can't build project using Vite due to following error:

Error: Build failed with 1 error:
node_modules/posthog-js/react/dist/esm/index.js:2:110: ERROR: Could not resolve "react"

This is due to following import:
CleanShot 2025-01-06 at 23 18 27

PostHog version: 1.204.0
Expected behavior: build passes successfully

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions