evenchange4 / svgr.macro

Run svgr at build-time with babel-plugin-macros.
MIT License
43 stars 4 forks source link

Module not found: Can't resolve 'module' in require-from-string #26

Open yotavm opened 6 years ago

yotavm commented 6 years ago

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
evenchange4 commented 6 years ago

@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.