Next.js wrapper giving me completely cryptic errors despite having sourcemap uploads
Bug description
I am getting hundreds of "minified react errors" despite having sourcemaps uploaded. There is no stack trace for any of these errors.
It seems almost none of my errors have stack traces even I am certain they're being uploaded:
How to reproduce
My next.config.ts:
import { withPostHogConfig } from "@posthog/nextjs-config";
export default withPostHogConfig(
{ ... },
{
envId: process.env["POSTHOG_ENV_ID"]!,
host: process.env["NEXT_PUBLIC_POSTHOG_HOST"],
personalApiKey: process.env["POSTHOG_API_KEY"]!,
sourcemaps: {
enabled: !!process.env["NEXT_PUBLIC_SERVER"],
project: "Redacted"
},
},
);
Related sub-libraries
- [ ] All of them
- [x] posthog-js (web)
- [ ] posthog-js-lite (web lite)
- [ ] posthog-node
- [ ] posthog-react-native
- [ ] @posthog/react
- [ ] @posthog/ai
- [x] @posthog/nextjs-config
Additional context
Thank you for your bug report – we love squashing them!
I'm having trouble getting sourcemaps to generate and upload - can I ask where you're getting the envId value from in posthog?
Another example
@PostHog/team-error-tracking
I've added some warning banners that explain the first two issues (minified react and non-error promises) in https://github.com/PostHog/posthog/pull/41424