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

Error: Failed to load external module node:crypto: TypeError: Native module not found: node:crypto #381

Closed
3 tasks
schematical opened this issue Feb 8, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@schematical
Copy link

schematical commented Feb 8, 2025

Bug description

Trying to initialize posthog-node on Node v23.7.0 and getting this error.

How to reproduce

  1. Add the code below.
  2. Try to run it with v23.7.0
  3. See error.

Related sub-libraries

  • All of them
  • [x ] posthog-web
  • posthog-node
  • posthog-react-native

Additional context

import {PostHog} from "posthog-node";
const posthog = {}; new PostHog(process.env.NEXT_PUBLIC_POSTHOG_KEY, {
    host: process.env.NEXT_PUBLIC_POSTHOG_HOST,
});

Also I am using this with NextJS. Following the instructions here:
https://vercel.com/guides/posthog-nextjs-vercel-feature-flags-analytics#3.-using-posthog-with-react-server-components

@schematical schematical added the bug Something isn't working label Feb 8, 2025
@schematical
Copy link
Author

Same issue on 22.10.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants