svgr.macro
svgr.macro copied to clipboard
Module not found: Can't resolve 'module' in require-from-string
i'm using create-react-map and this is my code
import React from 'react';
import styled from 'styled-components';
import toReactComponent from 'svgr.macro';
const Mask = toReactComponent('assets/icons/mask.svg');
class Icon extends React.Component {
render() {
return <StyledIcon {...this.props} />;
}
}
const StyledIcon = styled(Mask)`
width: 50px;
height: 50px;
& path {
stroke: ${({ color }) => color};
}
`;
export default Icon;
this is the error
/node_modules/require-from-string/index.js
Module not found: Can't resolve 'module' in '/Users/yotav/Desktop/500tech/projects/simplifi/client/node_modules/require-from-string
@yotavm I have no idea about this issue. :(
I use svgr.macro with styled-components^3.2.6 in my project without any errors.
It will be great to provide a standalone repo to reproduce it.