diff --git a/app/(app)/articles/_client.tsx b/app/(app)/articles/_client.tsx index 73e21cd0..1eea1c83 100644 --- a/app/(app)/articles/_client.tsx +++ b/app/(app)/articles/_client.tsx @@ -1,6 +1,6 @@ "use client"; -import { Children, Fragment, useEffect } from "react"; +import { Fragment, useEffect } from "react"; import { TagIcon } from "@heroicons/react/20/solid"; import ArticlePreview from "@/components/ArticlePreview/ArticlePreview"; import ArticleLoading from "@/components/ArticlePreview/ArticleLoading"; @@ -105,11 +105,7 @@ const ArticlesPage = () => { )} {status === "pending" && - Children.toArray( - Array.from({ length: 7 }, () => { - return ; - }), - )} + Array.from({ length: 7 }, (_, i) => )} {status === "success" && data.pages.map((page) => { return ( diff --git a/app/(app)/notifications/_client.tsx b/app/(app)/notifications/_client.tsx index e2b6e3e8..a5a3dfdc 100644 --- a/app/(app)/notifications/_client.tsx +++ b/app/(app)/notifications/_client.tsx @@ -1,6 +1,6 @@ "use client"; -import { Children, Fragment, useEffect } from "react"; +import { Fragment, useEffect } from "react"; import { useInView } from "react-intersection-observer"; import { CheckCircleIcon } from "@heroicons/react/20/solid"; import { Temporal } from "@js-temporal/polyfill"; @@ -91,11 +91,7 @@ const Notifications = () => {
Something went wrong... Please refresh your page.
)} {status === "pending" && - Children.toArray( - Array.from({ length: 7 }, () => { - return ; - }), - )} + Array.from({ length: 7 }, (_, i) => )} {status !== "pending" && noNotifications && (

No new notifications. ✅{" "} diff --git a/app/(app)/saved/_client.tsx b/app/(app)/saved/_client.tsx index 042a2a32..7a5a68c0 100644 --- a/app/(app)/saved/_client.tsx +++ b/app/(app)/saved/_client.tsx @@ -1,6 +1,5 @@ "use client"; -import { Children } from "react"; import ArticlePreview from "@/components/ArticlePreview/ArticlePreview"; import { api } from "@/server/trpc/react"; import PageHeading from "@/components/PageHeading/PageHeading"; @@ -33,11 +32,7 @@ const SavedPosts = () => { Saved items

{bookmarkStatus === "pending" && - Children.toArray( - Array.from({ length: 7 }, () => { - return ; - }), - )} + Array.from({ length: 7 }, (_, i) => )} {bookmarkStatus === "error" && (

Something went wrong fetching your saved posts... Refresh the page. diff --git a/components/SideBar/SideBarSavedPosts.tsx b/components/SideBar/SideBarSavedPosts.tsx index 3c152be8..fca498a2 100644 --- a/components/SideBar/SideBarSavedPosts.tsx +++ b/components/SideBar/SideBarSavedPosts.tsx @@ -1,6 +1,6 @@ "use client"; import { api } from "@/server/trpc/react"; -import React, { Children } from "react"; +import React from "react"; import SideBarSavedArticlePreview from "./SideBarSavedArticlePreview"; import Link from "next/link"; @@ -22,11 +22,9 @@ export default React.memo(function SideBarSavedPosts() {

{bookmarkStatus === "pending" && - Children.toArray( - Array.from({ length: howManySavedToShow }, () => { - return ; - }), - )} + Array.from({ length: howManySavedToShow }, (_, i) => ( + + ))} {bookmarkStatus === "error" && (

Something went wrong fetching your saved posts... Refresh the page. diff --git a/components/TrendingPosts/TrendingPostsLoading.tsx b/components/TrendingPosts/TrendingPostsLoading.tsx index bc4e0242..27d91932 100644 --- a/components/TrendingPosts/TrendingPostsLoading.tsx +++ b/components/TrendingPosts/TrendingPostsLoading.tsx @@ -1,14 +1,11 @@ -import { Children } from "react"; import ArticleLoading from "@/components/ArticlePreview/ArticleLoading"; function LoadingTrendingPosts() { return (

- {Children.toArray( - Array.from({ length: 5 }, () => { - return ; - }), - )} + {Array.from({ length: 5 }, (_, i) => ( + + ))}
); } diff --git a/next-env.d.ts b/next-env.d.ts index 9edff1c7..c4b7818f 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -1,6 +1,6 @@ /// /// -import "./.next/types/routes.d.ts"; +import "./.next/dev/types/routes.d.ts"; // NOTE: This file should not be edited // see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/next.config.js b/next.config.js index 0b1d983b..b5bd5a6e 100644 --- a/next.config.js +++ b/next.config.js @@ -20,6 +20,8 @@ const REMOTE_PATTERNS = [ })); const config = { + // Exclude jsdom and isomorphic-dompurify from bundling to fix ESM/CJS compatibility + serverExternalPackages: ["jsdom", "isomorphic-dompurify"], // Turbopack configuration for SVGR (replaces webpack config) turbopack: { rules: {