pivotal-ui: Can't use react-iconography by itself.

Error in ./~/pui-react-iconography/iconography.js
Module not found: 'svg-react' in /project/node_modules/pui-react-iconography

 @ ./~/pui-react-iconography/iconography.js 55:13-80

I’ve got that if I use iconography itself. And if I install svg-react-loader, i’ve got no error but lots of warning.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 15 (5 by maintainers)

Most upvoted comments

Yeah, create-react-app is pretty amazing out of the box. It clearly took a lot of time to build it.

For what it is worth, you can still use the Pivotal UI SVGs, you just can’t use them with React, and it is more annoying. If you still need PUI icons, check out the documentation for the CSS Iconography component (the staging styleguide still).

The ‘Non-whitespace before first tag’ error is because you have secret extra svg loaders that are converting the svg before it gets to the svg-react-loader.

Looking through create-react-app, they convert any svg into a file to be exported as an asset. This is normally great if you aren’t doing anything fancy, but it will break svg-react-loader. I’m not sure how to turn this off in create-react-app. I suggest that you don’t use create-react-app. It is great for getting started, but really hard to customize in any way. We provide our own starter app if you want to give it a try. There are a million react starters out there, just pick one you can configure.

For the moment, I’ve removed this package. And I was on firefox nightly. I’ll let you know when i’ll test it.