Unable to import a component from a file to another

Hi, i'm trying to get a select menu exported in a file in order to use it in another one by importing it but i get this error (i tried with buttons and i got the same thing):
When the function is in the same file i don't get the issue
TypeError: (0 , modulesMenu_1.buildSelectMenu) is not a function
    at Object.execute (\bot\dist\modules\setup\commands\module.js:52:68)
    at handleCommandInteraction (\bot\dist\modules\core\events\client\interactionCreate.js:36:27)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.execute (\bot\dist\modules\core\events\client\interactionCreate.js:17:13)


The func is :
export const buildSelectMenu = (guildSettings: IGuild) => {
  const selectMenu = new StringSelectMenuBuilder()
    .setCustomId("modulesMenu")
    .setPlaceholder(value)
    .addOptions(/*options*/);

  const row = new ActionRowBuilder<StringSelectMenuBuilder>().addComponents(selectMenu);
  return row;
};


and i call it like this with the good import:
const selectMenu = buildSelectMenu(guildSettings);


When the function buildSelectMenu is in the same file, i dont get this error

I'm using Typescript 5.1.6 and djs v14.11.0
Was this page helpful?