## Context
`posthog-js` can't be used in ESM/SSR Node projects (Remix/Vite): package.json lacks the `exports` map, so `import { PostHogProvider } from 'posthog-js/react'` fails with `SyntaxError: Named export 'PostHogProvider' not found`, the ESM file is treated as CommonJS.
## Verified resolution
Maintainer hpouillot: use the dedicated `@posthog/react` package (same code, proper ESM exports) instead of `posthog-js/react`, docs at posthog.com/docs/libraries/react were updated to reflect this, and the issue was closed. Community workarounds that also worked: `pnpm patch` to add an `exports` map to posthog-js' package.json, or `ssr: { noExternal: ['posthog-js'] }` in vite.config.ts.