fix(blog): avoid barrel import in client component to fix build

The blog-analytics.tsx client component was importing from the @/lib/blog
barrel export, which transitively included content.ts that uses the Node.js
fs module. This caused the build to fail with "Module not found: Cannot
resolve fs" error.

Changed imports to use direct file paths:
- Import BlogPost type from @/lib/blog/types
- Import analytics functions from @/lib/blog/analytics

This avoids pulling content.ts into the client bundle.
This commit is contained in:
Roo Code 2026-01-28 01:02:50 +00:00
parent 05416fd21d
commit 63d8d63f48

View file

@ -1,8 +1,13 @@
"use client"
import { useEffect, useRef } from "react"
import type { BlogPost } from "@/lib/blog"
import { trackBlogIndexView, trackBlogPostView, trackBlogPostScrollDepth, trackBlogPostTimeSpent } from "@/lib/blog"
import type { BlogPost } from "@/lib/blog/types"
import {
trackBlogIndexView,
trackBlogPostView,
trackBlogPostScrollDepth,
trackBlogPostTimeSpent,
} from "@/lib/blog/analytics"
interface BlogIndexAnalyticsProps {
postCount: number