I have a problem and that using the library es6-module-loader-dev
is giving me an error to get the classes that I'm importing. The truth initially I thought it was the route, but after checking them, see if the classes had the export and if everything was on the indicated routes I still get the error.
My code is as follows:
Car Class:
export default class vehicle {
constructor(){
}
}
Carros y drones class:
import Vehicle from './vehicle';
export class Car extends Vehicle {
constructor(){
super();
}
}
import {Vehicle} from './vehicle';
export default class Drone extends Vehicle {
constructor(){
super();
}
}
Main Class:
import {Car} from './classes/car';
import {Drone} from './classes/drone';
Index.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="node_modules/traceur/bin/traceur.js"></script>
<script src="node_modules/es6-module-loader/dist/es6-module-loader-dev.js"></script>
</head>
<body>
<script>
System.import('src/app.js');
</script>
</body>
</html>
Project structure:
The error that shows me in the browser is:
es6-module-loader-dev.src.js:1478 Uncaught (in promise) Error: Error loading http://localhost:3000/src/classes/car as "./classes/car" from http://localhost:3000/src/app.js XHR error (404 Not Found) loading http://localhost:3000/src/classes/car
at f (es6-module-loader-dev.src.js:1478)
at XMLHttpRequest.g.onreadystatechange (es6-module-loader-dev.src.js:1499)