.getTotalLength is not a function
See original GitHub issuegetting this error during tests: (Seems to be related to #72)
TypeError: _c.getTotalLength is not a function
...
at Object.getPosition (node_modules/.pnpm/registry.npmjs.org+react-xarrows@2.0.2_react@16.13.1/node_modules/react-xarrows/lib/index.js:1124:90)
at node_modules/.pnpm/registry.npmjs.org+react-xarrows@2.0.2_react@16.13.1/node_modules/react-xarrows/lib/index.js:180:37
at commitHookEffectListMount (node_modules/.pnpm/registry.npmjs.org+react-dom@16.13.1_react@16.13.1/node_modules/react-dom/cjs/react-dom.development.js:19731:26)
version: 2.0.2 using Jest and react testing library.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7
Top Results From Across the Web
Can't get getTotalLength() from <path> [closed] - Stack Overflow
You are trying to create a normal HTML-Element called path , which does not have any function called path.getTotalLength() . Try document.
Read more >getTotalLength() is no longer supported · Issue #155 - GitHub
getTotalLength() has been removed from the Web standards. ... setDashoffset causes "getTotalLength is not a function" error on svg circle ...
Read more >SVGGeometryElement.getTotalLength() - Web APIs | MDN
The SVGGeometryElement.getTotalLength() method returns the user agent's computed value for the total length of the path in user units.
Read more >typeerror: e.gettotallength is not a function syncfusion - You.com
You are trying to create a normal HTML-Element called path , which does not have any function called path.getTotalLength() . Try document.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was able to bypass it by mocking the component (I prefer not to conditionally render it based on the NODE_ENV).
Seems to still be no updates on this one…
For the time being, I have been working around it similar to DiaconuDan
{process.env.NODE_ENV !== 'test' && <Xarrow ... />
But definitely not an ideal solution!