I've seen several Questions related to this topic in SO and followed them (Loading a SVG file with svg.js) and no success trying to load a svg file.
__this.canvas = SVG('canvas').size(500, 500);
$.get('/cuentos/Rapunzel/prueba.svg', function(data) {
__this.data = data;
console.log(__this.data);
__this.canvas.svg(__this.data);
});
__this.canvas is type of svgjs.Doc which is imported in the following manner:
import SVG from './node_modules/svg.js/svg.js';
declare var svgjs: (domElement: HTMLElement) => svgjs.Library;
The error:
There's something i'm doing wrong or missing.
Any help?