fix: isolate detect-user-language from client bundle
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m33s
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m33s
Remove detectUserLanguage re-export from i18n barrel index.ts — it depends on next/headers (server-only) and was being pulled into client component bundles via sidebar.tsx → lib/i18n/index.ts, causing build failure. Add 'server-only' guard to detect-user-language.ts to make the constraint explicit.
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
/**
|
||||
* i18n exports
|
||||
* Centralized internationalization system with JSON-based translations
|
||||
* i18n exports — client-safe barrel
|
||||
* Centralized internationalization system with JSON-based translations.
|
||||
*
|
||||
* detectUserLanguage is intentionally NOT re-exported here because it depends
|
||||
* on next/headers (server-only). Import it directly:
|
||||
* import { detectUserLanguage } from '@/lib/i18n/detect-user-language'
|
||||
*/
|
||||
|
||||
export { LanguageProvider, useLanguage } from './LanguageProvider'
|
||||
export { detectUserLanguage } from './detect-user-language'
|
||||
export { loadTranslations, getTranslationValue, type SupportedLanguage, type Translations } from './load-translations'
|
||||
|
||||
Reference in New Issue
Block a user