JavaScript functions export error

Hi all, I am trying to export functions from one js file to another in UXP InDesign plugin but I am getting error

“Uncaught SyntaxError: Identifier ‘Test’ has already been declared at test.js:1:1”
Can anyone please help.
Thanks

Here is my code:

main.js

const {Test} = require("./test")
const { entrypoints } = require("uxp");
const { app } = require("indesign");

entrypoints.setup({
  commands: {
    showAlert: () => showAlert()
  },
  panels: {
    showPanel: {
      show({node} = {}) {}
    }
  }
});

showAlert = () => {
  Test.display()
    const dialog = app.dialogs.add();
    const col = dialog.dialogColumns.add();
    const colText = col.staticTexts.add();
    colText.staticLabel = "Congratulations! You just executed your first command.";

    dialog.canCancel = false;
    dialog.show();
    dialog.destroy();
    return;
}

test.js

 var Test = {
    text : "hhhhh",

    display : function() {
        console.log(this.text);
    }
}

module.exports = {Test};

If you’re using the two script tags from the other thread, I’d assume both go into the same scope, so the var Test conflicts with the earlier const.
What happens, if you require(“./test.js”) to load your module and omit the second script tag ?

@Dirk ,Now it throws error:

“uxp://uxp-internal/domjs_scripts.js:2 Uncaught ReferenceError: module is not defined”

I have made following changes in main.js:

require("./test")
const { entrypoints } = require("uxp");
const { app } = require("indesign");

entrypoints.setup({
  commands: {
    showAlert: () => showAlert()
  },
  panels: {
    showPanel: {
      show({node} = {}) {}
    }
  }
});

showAlert = () => {
  Test.display()
    const dialog = app.dialogs.add();
    const col = dialog.dialogColumns.add();
    const colText = col.staticTexts.add();
    colText.staticLabel = "Congratulations! You just executed your first command.";

    dialog.canCancel = false;
    dialog.show();
    dialog.destroy();
    return;
}

@Jarda can you please help.

I am not interested in solving this.