Skip to content

document is not defiend error with generating types for svgedit #1148

@mscherotter

Description

@mscherotter

Error when generating types for SVGEdit:

npm install -g svgedit
dts-gen -m svgedit

Output:

Unexpected crash! Please log a bug with the commandline you specified.
file:///D:/Source/Repos/svgedit-page/node_modules/svgedit/dist/editor/Editor.js:1
 const Tr={type:"logger",log(Tr){this.output("log",Tr)},warn(Tr){this.output("warn",Tr)},error(Tr) 
{this.output("error",Tr)},output(Tr,Ur){console&&console[Tr]&&console[Tr].apply(console,Ur)}};class 
Logger{constructor(Tr){let Ur=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(Tr,Ur)}init(Ur) 
{let Rr=arguments.length>1&&void 0!==arguments[1]?arguments[1]: 
{};this.prefix=Rr.prefix||"i18next:",this.logger=Ur||Tr,this.options=Rr,this.debug=Rr.debug}log(){for(var 
Tr=arguments.length,Ur=new Array(Tr),Rr=0;Rr<Tr;Rr++)Ur[Rr]=arguments[Rr];return 
this.forward(Ur,"log","",!0)}warn(){for(va
...
ReferenceError: document is not defined
at file:///D:/Source/Repos/svgedit-page/node_modules/svgedit/dist/editor/Editor.js:1:58902
at ModuleJobSync.runSync (node:internal/modules/esm/module_job:395:35)
at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:360:47)
at loadESMFromCJS (node:internal/modules/cjs/loader:1385:24)
at Module._compile (node:internal/modules/cjs/loader:1536:5)
at Object..js (node:internal/modules/cjs/loader:1706:10)
at Module.load (node:internal/modules/cjs/loader:1289:32)
at Function._load (node:internal/modules/cjs/loader:1108:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions