Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while executing #66

Open
ganesshkumar opened this issue Jun 12, 2021 · 1 comment
Open

Error while executing #66

ganesshkumar opened this issue Jun 12, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@ganesshkumar
Copy link

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?

@brochington
Copy link
Contributor

Thanks for trying this out! This looks like it's ESM related. At the moment I'm in the process of moving, so not able to debug this, but you can try to clone the repo locally and build it, then npm link it into your project. Both UMD and ESM builds should be created. Will try to take a look at this when I can.

@brochington brochington added the bug Something isn't working label Jun 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants