DOMException: Failed to execute 'importNode' on 'Document'
See original GitHub issueAfter migrating to v3.0.5 the plugin throws the following error:
browser-symbol.js?59cf:52 Uncaught (in promise) DOMException: Failed to execute 'importNode' on 'Document': The imported node has an invalid namespace.
at parse (webpack-internal:///./node_modules/svg-baker-runtime/browser-symbol.js:52:21)
It still works fine.
My webpack config:
{
test: /\.svg$/,
include: /sprite/,
loader: 'svg-sprite-loader',
},
And I use it like this:
import glyph from 'images/svg.svg';
...
<svg viewBox={glyph.viewBox}>
<use xlinkHref={`#${glyph.id}`} />
</svg>
- Node.js version: 6.9.4
- webpack version: 3.1.0
- svg-sprite-loader version: 3.0.5
- OS type & version: MacOS Sierra 10.12.5
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (4 by maintainers)
Top Results From Across the Web
Solving `Failed to execute 'importNode' on 'Document'` in ...
js. Alpine Expression Error: Failed to execute 'importNode' on 'Document': parameter 1 is not of type 'Node'.
Read more >Failed to execute 'importNode' on 'Document': parameter 1 ...
For a new project I used the template linking code from here: ... Uncaught TypeError: Failed to execute 'importNode' on 'Document': ...
Read more >Why isn't importNode executing when everything is fine?
When I log the "test" variable to the console, I am getting the document that contains File1 so it's fine there. I just...
Read more >Document.importNode() - Web APIs | MDN
The Document object's importNode() method creates a copy of a Node or DocumentFragment from another document, to be inserted into the ...
Read more >Example usage for org.w3c.dom Document importNode
appendChild(document.importNode(details.getFirstChild(), true)); return document; } else { logger.error("Error querying CoNE: Status " + detailMethod.
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
@gazpachu I fixed my issues by removing
metadata
tags from my SVGs as I described here: https://github.com/kisenka/svg-sprite-loader/issues/154#issuecomment-316008710So it works well for me since than.
I’m sorry, I pasted code of a wrong SVG. This is the one that causes the issue:
And removing this weird piece of code:
fixes the issue.