I have the following simple structure (backend is using Python Flask):
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
</head>
<body>
<script type="module" src="static/js/AClass.js"></script>
<script type="text/javascript">
var logging_url = "http://127.0.0.1:5000";
var a_class = new AClass("some data");
a_class.initialize();
</script>
</body>
</html>
And in my static/js
folder I have the following files:
static/js/AClass.js
:
import DataManager from './DataManager.js';
class AClass {
constructor(constructor_param) {
this.datamanager = undefined;
}
initialize() {
console.log("Initializing...");
this.datamanager = new DataManager();
}
}
DataManager.js
currently is an empty class in static/js/
When I run this stuff in my browser I the get following error:
Uncaught ReferenceError: AClass is not defined
However, I do not know why?