Open Nfinished opened 1 year ago
Hi. Can you show your code? What module are you trying to import?
Sorry, dunno why I didn't include it to begin with.
// segment.ts
import { AnalyticsBrowser } from '@segment/analytics-next'
import 'client-only'
const segment = AnalyticsBrowser.load({
writeKey: process.env.NEXT_PUBLIC_SEGMENT_WRITE_KEY as string,
})
export default segment
// Segment.tsx
'use client'
import '@/utils/segment'
export default function Segment() {
return null
}
Thanks. Haven't had time to look into this yet, but FYI: all node stuff is getting deleted from this package in around a month, maybe sooner. Pretty sure that will fix the issue.
Has this been fixed @silesky?
Node v18.12.1 Next v13.3.0 pnpm v 8.1.1
segment.ts is poisoned with
client-only
Segment.tsx is a client component