I'm trying to import an external module with SystemJs in Angular doing
import { System } from 'systemjs';
declare const SystemJS: System;
...
SystemJs.import('./assets/example/example.js').then(m=>{
console.log('the module is', m);
});
I also tried with http://localhost:4200/assets/example/example.js
The js file is there and accessible.
But I'm getting an error:
ERROR Error: Uncaught (in promise): Error: Cannot find module 'http://localhost:4200/assets/example/example.js'
I tried it in a clean project and it works fine, so I think the problem can be related to some angular specific configuration.
Any clue about what can be wrong?