Module not working on localhost

im using 2 files village_simulator_core.js and village_simulator_ui.js in village_simulator_core i exported object villageSimulatorCore as follows

export const villageSimulatorCore = {
    village: {
        population: {
            total: 100,
            free: 80,
            workers: 20,
            soldiers: {
                peasants: 0,
                lancers: 0,
                swordsmen: 0,
                horsemen: 0,
                archers: 0,
            },
        },

on village_simulator_ui i import the object with : import { villageSimulatorCore } from ‘./village_simulator_core.js’ . Both files are declared with in index.html. I get the error :

Uncaught ReferenceError: villageSimulatorCore is not defined
    at Object.simulateTick (village_simulator_ui.js:72:9)
    at village_simulator_ui.js:89:32

can ssomeone help ? the local server is http-server under node.js

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

are both files in the same path?
You should share a snapshot of your folder

now i get another error

Uncaught SyntaxError: The requested module './battle.js' does not provide an export named 'UnitFactory' (at village_simulator_core.js:2:18)

but battle.js have an object called unitFactory exported

unitFactory and UnitFactory are not the same, I don’t know if the typo is in your message or if the situation is that

the tipo is in the mesage, its UnitFactory