I'm learning JavaScript concretely modules and I want to test everything I have learned about modules, but when I'm connecting file it and running it throws an error and I don't understand why.
Here is the error:
Here is the HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Modules</title>
</head>
<body>
<script type="module" src="script.js"></script>
</body>
</html>
First JS file:
export const module = {
one: "one",
second: "second",
third: "third"
};
Second JS file:
import {module} from "./modules.js";
console.log(module);
Please say what is wrong and what should I do?