-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Using inline SVGs from Inkscape fails with "SyntaxError: unknown: Namespace tags are not supported by default." #3689
Comments
This issue seems to be fixed if SVGO optimisation is switched on for SVGR:
Making the following change to that line solves the problem for me, as the default configuration for SVGO removes all editor-related namespace tags: -use: '@svgr/webpack?-prettier,-svgo,+titleProp,+ref![path]',
+use: '@svgr/webpack?-prettier,+svgo,+titleProp,+ref![path]', I'm happy to submit a PR with this change if you're open to that. |
I think that would be great. |
how did you solve it? I didn't get |
Tries to save in optimized mode. And check mark removes metadata. |
🐛 Bug Report
Using a SVG created by Inkscape using its default Inkscape-extended SVG format with the inline SVG feature fails with
SyntaxError: unknown: Namespace tags are not supported by default. React's JSX doesn't support namespace tags. You can set `throwIfNamespace: false` to bypass this warning.
Have you read the Contributing Guidelines on issues?
Yes
To Reproduce
Create a SVG in Inkscape and save in the default SVG file format (I've attached one for reference)
Reference the SVG using the inline SVG syntax, for example:
Expected behavior
SVG is loaded and displayed correctly
Actual Behavior
Error is thrown during compilation:
Your Environment
Reproducible Demo
Repo: https://github.com/charleskorn/docusaurus-svg-issue
Run
yarn start
oryarn build
to see error.The text was updated successfully, but these errors were encountered: