jhamlet / svg-react-loader

Webpack SVG to React Component Loader
MIT License
559 stars 82 forks source link

Error loading SVG with -- (two consecutive dashes) in the name #93

Closed cupojoe closed 6 years ago

cupojoe commented 6 years ago

This is the error from the Gatsby build:

Module build failed: TypeError: Cannot read property 'toUpperCase' of undefined at upperCaseFirst (/node_modules/svg-react-loader/lib/util/upper-case-first.js:2:19) at Array.map (<anonymous>) at titleCase (/node_modules/svg-react-loader/lib/util/title-case.js:10:9) at /node_modules/svg-react-loader/node_modules/ramda/dist/ramda.js:551:35 at /node_modules/svg-react-loader/node_modules/ramda/dist/ramda.js:48:27 at titleCaseBasename (/node_modules/svg-react-loader/lib/loader.js:10:28) at Object.svgReactLoader (/node_modules/svg-react-loader/lib/loader.js:29:41) @ ./src/components/Nav.js 44:22-72

Changing the name to one dash fixes the issue, but unfortunately this is using a third party library of icons, probably won't be able to change it.

cupojoe commented 6 years ago

@jhamlet do you have any idea what could be causing this?

jhamlet commented 6 years ago

Fixed with your pull request?

cupojoe commented 6 years ago

@jhamlet yeah, that PR fixes it. Thank you!