diff --git a/packages/ozone/src/mod-service/lang.ts b/packages/ozone/src/mod-service/lang.ts index 08cb6f69d87..6c17f11ad1e 100644 --- a/packages/ozone/src/mod-service/lang.ts +++ b/packages/ozone/src/mod-service/lang.ts @@ -1,10 +1,3 @@ -import lande from 'lande' - -import { ModerationService } from '.' -import { ModSubject } from './subject' -import { ModerationSubjectStatusRow } from './types' -import { langLogger as log } from '../logger' -import { code3ToCode2 } from './lang-data' import { AppBskyActorProfile, AppBskyFeedGenerator, @@ -12,6 +5,12 @@ import { AppBskyGraphList, } from '@atproto/api' +import { ModerationService } from '.' +import { ModSubject } from './subject' +import { ModerationSubjectStatusRow } from './types' +import { langLogger as log } from '../logger' +import { code3ToCode2 } from './lang-data' + export class ModerationLangService { constructor(private moderationService: ModerationService) {} @@ -102,6 +101,8 @@ export class ModerationLangService { .map((lang) => lang.split('-')[0]) .forEach((lang) => langs.add(lang)) } else if (recordText) { + // 'lande' is an esm module, so we need to import it dynamically + const { default: lande } = await import('lande') const detectedLanguages = lande(recordText) if (detectedLanguages.length) { const langCode = code3ToCode2(detectedLanguages[0][0])