-
-
Notifications
You must be signed in to change notification settings - Fork 866
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
Invariant Violation: Invalid tag for SVG #881
Comments
I have the same problem, using @svgr |
Instead of using
The combination of the two above items will let you do (edit: I updated the plugin configuration to a single file and cleaned it up so someone else can leverage this code easily) |
@jakobo Thanks for sharing. I'm getting |
I'll update the module above to be more safe. Testing |
Thanks, so there is no need to use
I get error:
Are plugins not part of |
If you've got a custom
I also found the issue with the plugin above from extraction and will fix it. Edit: see #881 (comment) for a working plugin in your |
Thanks, yes - I'm also in the babel 7 boat. With custom |
@kkarkos I'd go with the plugin I revised above then: (#881 (comment)) I just brought up my dev server with that plugin and verified it worked, but let me know if you get any errors with it. |
@jakobo Cheers! This brings up the following:
Might be related to #912 but I removed |
Ok - found the issue. |
@jakobo have you wrapped this up into an npm module yet? If not, would you have any issues with me doing so if I gave you original author credit? EDIT, this isn't working for me, I spoke to soon. Still getting this error on the server :(
|
Before going on the hook for a plug-in, I'd consider upgrading to Razzle v3 which has Babel 7 support. Then it becomes a straightforward
|
Any ideas of how to solve this for TypeScript projects without babel? |
My solution was to move all our svg's and png's to a cdn. This was they are only a url string server side. I couldn't get any of this to work using razzle 3 and babel 7, blah |
After doing some more attempts, I got
to in the end use it like this:
This works, however in my opinion it doesn't feel like a solid solution. It feels like there is some internal Razzle implementation that collides with |
As some of you guys wanted the svgo support for Razzle I created a plugin which uses @svgr/webpack and it seems to work just fine (I'm using it myself 😄). |
|
What is the content of the step1.svg file? |
|
@youcanping - it might be that those special characters are not supported by SVGO, which is used by svgr. Can you please try with that one?
|
ok,i try it |
Okay, the problem is that the configuration I added earlier has not been removed
|
@youcanping - that makes sense as two svgr's were colliding I guess 😉 |
|
I was using
svg-react-loader
to import SVG in component in client side app.I am trying to move to server-side and working around to integrate Razzle, resolving errors.
Somehow svgs are not working. When I open the url, this what getting displayed:
build/static/media/
folder has two variant of each images, one has svg code other has react code to render svg.The image in above pic has react code:
Any solution?
The text was updated successfully, but these errors were encountered: