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

Failure with some svg tags #12

Closed
MoOx opened this issue Feb 6, 2016 · 4 comments
Closed

Failure with some svg tags #12

MoOx opened this issue Feb 6, 2016 · 4 comments
Assignees
Labels
Milestone

Comments

@MoOx
Copy link

MoOx commented Feb 6, 2016

ModuleParseError: Module parse failed: /Users/MoOx/Sync/Development/statinamic/docs/node_modules/svg-react-loader/index.js!/Users/MoOx/Sync/Development/statinamic/logo/statinamic-text.svg Line 21: Unexpected token <
You may need an appropriate loader to handle this file type.
| 
|         return (
|             <svg {...this.props}>
|                   <title>statinamic</title>
|   <desc>Created with Sketch.</desc>

It seems desc and title should be removed.

@jhamlet
Copy link
Owner

jhamlet commented Feb 6, 2016

Do you have a svg file you can attach that I can reproduce the issue?

@jhamlet jhamlet added the bug label Feb 6, 2016
@MoOx
Copy link
Author

MoOx commented Feb 6, 2016

https://raw.githubusercontent.com/MoOx/statinamic/4093478de3da8f1ccba3c328b253b12b92f7479f/logo/statinamic-text.svg

A workaround is using svgo-loader before with { removeTitle: true } in plugins.

@jhamlet
Copy link
Owner

jhamlet commented Feb 6, 2016

title and desc are valid svg element tag names... but, maybe not within React...

Are you using babel in your loader pipeline?

@jhamlet jhamlet added this to the v0.3.3 milestone Feb 6, 2016
@MoOx
Copy link
Author

MoOx commented Feb 7, 2016

I was using it in a weird context, on server side https://github.com/istarkov/babel-plugin-webpack-loaders, so got stuck with another issue.

@jhamlet jhamlet modified the milestones: v0.4.0, v0.3.3 Mar 3, 2016
@jhamlet jhamlet self-assigned this Mar 3, 2016
@jhamlet jhamlet closed this as completed Jul 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants