From 66b015e73d4c7177f707fd0decf158d39aa21ebe Mon Sep 17 00:00:00 2001 From: MacRimi <123239993+MacRimi@users.noreply.github.com> Date: Fri, 14 Feb 2025 17:54:52 +0100 Subject: [PATCH] Update page.tsx --- web/app/changelog/page.tsx | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/web/app/changelog/page.tsx b/web/app/changelog/page.tsx index 6cd6e9c..596ae5d 100644 --- a/web/app/changelog/page.tsx +++ b/web/app/changelog/page.tsx @@ -5,20 +5,25 @@ import html from "remark-html" async function getChangelog() { const changelogPath = path.join(process.cwd(), "..", "CHANGELOG.md") - const fileContents = fs.readFileSync(changelogPath, "utf8") - - const result = await remark().use(html).process(fileContents) - return result.toString() + try { + const fileContents = fs.readFileSync(changelogPath, "utf8") + const result = await remark().use(html).process(fileContents) + return result.toString() + } catch (error) { + console.error("Error reading changelog file:", error) + return "
Changelog content not found.
" + } } export default async function ChangelogPage() { const changelogContent = await getChangelog() return ( -