I just ran the example on my machine
import svgToEx from 'svg-to-excalidraw';
const heartSVG = `
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<path d="M 10,30
A 20,20 0,0,1 50,30
A 20,20 0,0,1 90,30
Q 90,60 50,90
Q 10,60 10,30 z"/>
</svg>
`;
const { hasErrors, errors, content } = svgToEx.convert(heartSVG);
and got the following error,
ReferenceError: self is not defined
at Object.<anonymous> (<redacted>\node_modules\svg-to-excalidraw\dist\bundle.js:1:242)
at Module._compile (internal/modules/cjs/loader.js:1068:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
at Module.load (internal/modules/cjs/loader.js:933:32)
at Function.Module._load (internal/modules/cjs/loader.js:774:14)
at ModuleWrap.<anonymous> (internal/modules/esm/translators.js:199:29)
at ModuleJob.run (internal/modules/esm/module_job.js:152:23)
at async Loader.import (internal/modules/esm/loader.js:177:24)
at async Object.loadESM (internal/process/esm_loader.js:68:5)
Any pointers on how to fix this?
I just ran the example on my machine
and got the following error,
Any pointers on how to fix this?