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

TypeError: The provided value is not of type 'Element' #49

Open
TheDAS-designer opened this issue Mar 11, 2021 · 0 comments
Open

TypeError: The provided value is not of type 'Element' #49

TheDAS-designer opened this issue Mar 11, 2021 · 0 comments

Comments

@TheDAS-designer
Copy link

svgString error1: TypeError: The provided value is not of type 'Element'.
at Object.push../node_modules/jsdom/lib/jsdom/living/generated/Element.js.exports.convert (Element.js:26)
at Window.getComputedStyle (Window.js:781)
at SVGElement.setContext (parse-font.js:102)
at SVGElement.render (parse-font.js:102)
at Screen.render (parse-font.js:102)
at Screen.start (parse-font.js:102)
at Canvg.start (parse-font.js:102)
at Canvg._callee$ (parse-font.js:102)
at tryCatch (runtime.js:63)
at Generator.invoke [as _invoke] (runtime.js:293)
at Generator.next (runtime.js:118)
at asyncGeneratorStep (asyncToGenerator.js:5)
at _next (asyncToGenerator.js:27)
at asyncToGenerator.js:34
at new Promise ()
at new Wrapper (export.js:15)
at Canvg. (asyncToGenerator.js:23)
at Canvg.render (parse-font.js:102)
at convert (index.js:73)
at index.js:40
at loadSVGContent (index.js:178)
at svg2img (index.js:26)
at getColorFromSvg (useColor.ts:85)
at useColor.ts:122
at commitHookEffectListMount (react-dom.development.js:19731)
at commitLifeCycles (react-dom.development.js:19787)
at commitLayoutEffects (react-dom.development.js:22803)
at HTMLUnknownElement.callCallback (react-dom.development.js:188)
at Object.invokeGuardedCallbackDev (react-dom.development.js:237)
at invokeGuardedCallback (react-dom.development.js:292)
at commitRootImpl (react-dom.development.js:22541)
at unstable_runWithPriority (scheduler.development.js:653)
at runWithPriority$1 (react-dom.development.js:11039)
at commitRoot (react-dom.development.js:22381)
at finishSyncRender (react-dom.development.js:21807)
at performSyncWorkOnRoot (react-dom.development.js:21793)
at react-dom.development.js:11089
at unstable_runWithPriority (scheduler.development.js:653)
at runWithPriority$1 (react-dom.development.js:11039)
at flushSyncCallbackQueueImpl (react-dom.development.js:11084)
at flushSyncCallbackQueue (react-dom.development.js:11072)
at scheduleUpdateOnFiber (react-dom.development.js:21199)
at dispatchAction (react-dom.development.js:15660)
at index.tsx:227

` var svgString = [
'<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="236" height="120" ',
'viewBox="0 0 236 120">',
'',
''
].join('');
console.log('svgString svgString:', svgString)

svg2img(svgString, function (error, buffer) {
//returns a Buffer
console.log('svgString buffer1:', buffer)
console.log('svgString error1:', error)
});`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant