Skip to content

Commit

Permalink
add draft solution for require errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bgawkuc committed Jun 6, 2024
1 parent b825ac9 commit 2286f81
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion desktop/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type CreateDownloadQueue = () => {
dequeueDownloadItem: () => DownloadItem | undefined;
};

const createDownloadQueue: CreateDownloadQueue = require('./createDownloadQueue').default;
const createDownloadQueue = (require('./createDownloadQueue') as {default: CreateDownloadQueue}).default;

const port = process.env.PORT ?? 8082;
const {DESKTOP_SHORTCUT_ACCELERATOR, LOCALES} = CONST;
Expand Down
4 changes: 2 additions & 2 deletions src/libs/EmojiUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ function getAddedEmojis(currentEmojis: Emoji[], formerEmojis: Emoji[]): Emoji[]
*/
function replaceEmojis(text: string, preferredSkinTone: OnyxEntry<number | string> = CONST.EMOJI_DEFAULT_SKIN_TONE, lang: Locale = CONST.LOCALES.DEFAULT): ReplacedEmoji {
// emojisTrie is importing the emoji JSON file on the app starting and we want to avoid it
const emojisTrie: typeof EmojiTrie = require('./EmojiTrie').default;
const emojisTrie: typeof EmojiTrie = (require('./EmojiTrie') as {default: typeof EmojiTrie}).default;

const trie = emojisTrie[lang as SupportedLanguage];
if (!trie) {
Expand Down Expand Up @@ -392,7 +392,7 @@ function replaceAndExtractEmojis(text: string, preferredSkinTone: OnyxEntry<numb
*/
function suggestEmojis(text: string, lang: Locale, limit: number = CONST.AUTO_COMPLETE_SUGGESTER.MAX_AMOUNT_OF_SUGGESTIONS): Emoji[] | undefined {
// emojisTrie is importing the emoji JSON file on the app starting and we want to avoid it
const emojisTrie: typeof EmojiTrie = require('./EmojiTrie').default;
const emojisTrie = (require('./EmojiTrie') as {default: typeof EmojiTrie}).default;

const trie = emojisTrie[lang as SupportedLanguage];
if (!trie) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function createModalStackNavigator<TStackParams extends ParamListBase>(screens:
}

const MoneyRequestModalStackNavigator = createModalStackNavigator<MoneyRequestNavigatorParamList>({
[SCREENS.MONEY_REQUEST.START]: () => require('../../../../pages/iou/request/IOURequestRedirectToStartPage').default as React.ComponentType,
[SCREENS.MONEY_REQUEST.START]: () => (require('../../../../pages/iou/request/IOURequestRedirectToStartPage') as {default: React.ComponentType}).default,
[SCREENS.MONEY_REQUEST.CREATE]: () => require('../../../../pages/iou/request/IOURequestStartPage').default as React.ComponentType,
[SCREENS.MONEY_REQUEST.STEP_CONFIRMATION]: () => require('../../../../pages/iou/request/step/IOURequestStepConfirmation').default as React.ComponentType,
[SCREENS.MONEY_REQUEST.STEP_AMOUNT]: () => require('../../../../pages/iou/request/step/IOURequestStepAmount').default as React.ComponentType,
Expand Down

0 comments on commit 2286f81

Please sign in to comment.