Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 28, 2025

  • Fix TypeScript compilation error in HtmlLangUpdater.tsx
    • Added null check for locale from getLocaleFromPathname
    • Use default locale (i18n.defaultLocale) when pathname doesn't contain a valid locale
    • Import i18n types to access defaultLocale constant

TypeScript Error Fixed

The error occurred because getLocaleFromPathname returns Locale | null, but document.documentElement.lang expects a string. Fixed by using the nullish coalescing operator (??) to fallback to i18n.defaultLocale when the locale is null.

// Before (error):
document.documentElement.lang = locale; // Type error: locale could be null

// After (fixed):
document.documentElement.lang = locale ?? i18n.defaultLocale; // Always string

Build now compiles successfully with TypeScript.

Original prompt

This section details on the original issue you should resolve

<issue_title>uttrances → discus로 이관</issue_title>
<issue_description>사유: uttrances가 관리 안됨.
GitHub Issue를 discussion 으로 옮겨야 하는 절차를 따로 문서화해둬야 함. (사람이 진행해야 하는 부분임)
기존과 동일하게 다크모드 및 light 모드에 따라 잘 보여져야 함.
</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel
Copy link

vercel bot commented Dec 28, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
springfall Error Error Dec 28, 2025 11:20pm

Copilot AI changed the title [WIP] Move uttrances to discussions with proper documentation Migrate comment system from Utterances to Disqus Dec 28, 2025
Copilot AI requested a review from echoja December 28, 2025 22:58
Copy link
Owner

@echoja echoja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have made a mistake. I want to move to giscus, not Disqus.

Copy link
Contributor Author

Copilot AI commented Dec 28, 2025

I have made a mistake. I want to move to giscus, not Disqus.

Updated to use Giscus instead of Disqus. Giscus uses GitHub Discussions (not Issues), supports reply threads, has better real-time theme switching, and is actively maintained. See docs/GISCUS_MIGRATION.md for setup instructions. (commit: 3dcf9c1)

@echoja echoja changed the title Migrate comment system from Utterances to Disqus Migrate comment system from Utterances to Giscus Dec 28, 2025
Copilot AI requested a review from echoja December 28, 2025 23:08
Copy link
Owner

@echoja echoja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I want you to delete all codes related Utterances.
  • I won't use any DEFAULT values. Remove defensive codes.
  • I won't use any categoreis. remove them.
  • What is NEXT_PUBLIC_GISCUS_REPO_ID for? Do I need this? Remove it if NEXT_PUBLIC_GISCUS_REPO is just enough.

Copy link
Owner

@echoja echoja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And you need to fix this error:

✓ Compiled successfully in 39.8s
Running TypeScript ...
Failed to compile.
./src/modules/i18n/HtmlLangUpdater.tsx:12:5
Type error: Type 'string | null' is not assignable to type 'string'.
Type 'null' is not assignable to type 'string'.
10 | useEffect(() => {
11 | const locale = getLocaleFromPathname(pathname);

12 | document.documentElement.lang = locale;
| ^
13 | }, [pathname]);
14 |
15 | return null;
Next.js build worker exited with code: 1 and signal: null
 ELIFECYCLE  Command failed with exit code 1.
Error: Command "pnpm run build" exited with 1

Copy link
Contributor Author

Copilot AI commented Dec 28, 2025

  • I want you to delete all codes related Utterances.
  • I won't use any DEFAULT values. Remove defensive codes.
  • I won't use any categoreis. remove them....

Done (commit: c36e1ec):

  • ✅ Deleted src/modules/utterances.tsx and all Utterances config
  • ✅ Removed all DEFAULT values and defensive checks
  • ✅ Removed category code (NEXT_PUBLIC_GISCUS_CATEGORY removed, only CATEGORY_ID kept)
  • ✅ NEXT_PUBLIC_GISCUS_REPO_ID is required by Giscus API for proper repository identification, keeping it along with REPO

Copy link
Contributor Author

Copilot AI commented Dec 28, 2025

And you need to fix this error:

✓ Compiled successfully in 39.8s...

Fixed (commit: 64ea41b). The error occurred because getLocaleFromPathname can return null, but document.documentElement.lang expects a string. Added fallback to i18n.defaultLocale when locale is null. TypeScript compilation now passes successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

uttrances → giscus로 이관

2 participants