-
Notifications
You must be signed in to change notification settings - Fork 92
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
Unable to read certain svg file #76
Comments
Seems like you're using next.js; I'm not sure if that works with this transform or not - or are you saying it works with other SVGs, just not this one? |
Yes, I use next.js. It works with other svgs, just not this one fo some reason. I've put it through svgo and that stripped the svg a bit. The error message is rather cryptic for me, especially in this context. |
The implication is that there's something in the svg that svgo's parser isn't recognizing as an svg tag; perhaps the |
I think it's related to this |
it seems like any svg files that have |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
i'm also getting similar error ERROR in ./src/pages/Store/Product/ImageDetail/index.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: experiments/react/front/src/pages/Store/Product/ImageDetail/index.js: Property value of ObjectProperty expected node to be of a type ["Expression","PatternLike"] but instead got "JSXExpressionContainer"
at Object.validate (/experiments/react/front/node_modules/@babel/types/lib/definitions/utils.js:132:11)
at validateField (/experiments/react/front/node_modules/@babel/types/lib/validators/validate.js:24:9)
at validate (/experiments/react/front/node_modules/@babel/types/lib/validators/validate.js:17:3)
at builder (/experiments/react/front/node_modules/@babel/types/lib/builders/builder.js:40:27)
at Object.objectProperty (/experiments/react/front/node_modules/@babel/types/lib/builders/generated/index.js:399:31)
at /experiments/react/front/node_modules/babel-plugin-inline-react-svg/lib/index.js:135:33
at Array.forEach (<anonymous>)
at applyPlugin (/experiments/react/front/node_modules/babel-plugin-inline-react-svg/lib/index.js:131:43)
at PluginPass.ImportDeclaration (/experiments/react/front/node_modules/babel-plugin-inline-react-svg/lib/index.js:201:11)
at newFn (/experiments/react/front/node_modules/@babel/traverse/lib/visitors.js:175:21)
@ ./src/pages/Store/Product/index.js 151:42-66
@ ./src/routes/index.js
@ ./src/client.js
@ multi @babel/polyfill ./tools/lib/webpackHotDevClient ./src/client.js
file ImageDetail/index.js import Zoom from './svg/zoom.svg';
import './ImageDetail.scss';
const ImageDetail = () => (
<p styleName="container">
<span styleName="zoom">
<Zoom />
</span>
Touch and drag
</p>
);
export default ImageDetail; Not sure if related to svg |
I experience this error exactly when the |
Not sure why this was closed. It there any fix availible that works for people? I'm experiencing the same. Unable to render the svg when a style attribute is present. In theory, the My current workaround involves running svgo manually on |
If the same version svgo can do it directly, but not via this transform, then that's something we should be able to fix. |
amazing works like charm🤩 |
It appears that this plugin is unable to read certain svgs.
svg:
error
The text was updated successfully, but these errors were encountered: