Cannot import fontello generated css in React

128 views Asked by At

When I want to import Fontello auto-generated CSS file in my App.jsx it gives me an error:

./src/assets/fontello/css/fontello.css (./node_modules/css-loader/dist/cjs.js??ref--5-oneOf-4-1!./node_modules/postcss-loader/src??postcss!./src/assets/fontello/css/fontello.css)
    Syntax error: Unknown word (58:1)

  56 | }
  57 |  
> 58 | .icon-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="14.766" viewBox="0 0 16 14.766">   <g id="Examples" transform="translate(-246.5 -7.77)">     <g id="albums-outline" transform="translate(198.5 -56.23)">       <g id="Group_59" data-name="Group 59" transform="translate(48 67.432)">         <path id="Path_67" data-name="Path 67" d="M62.27,171.334H49.727A1.747,1.747,0,0,1,48,169.567v-7.8A1.749,1.749,0,0,1,49.727,160H62.273A1.749,1.749,0,0,1,64,161.767v7.8A1.752,1.752,0,0,1,62.27,171.334ZM49.727,161.259a.5.5,0,0,0-.5.508v7.8a.5.5,0,0,0,.5.508H62.273a.5.5,0,0,0,.5-.508v-7.8a.5.5,0,0,0-.5-.508Z" transform="translate(-48 -160)" fill="#30c0b0"/>       </g>       <g id="Group_60" data-name="Group 60" transform="translate(49.716 64)">         <path id="Path_68" data-name="Path 68" d="M113.269,80h8.883M112,81.716h11.42" transform="translate(-111.428 -79.428)" fill="#30c0b0"/>         <path id="Path_69" data-name="Path 69" d="M107.936,66.86H96.628a.575.575,0,1,1,0-1.144h11.308a.575.575,0,1,1,0,1.144Zm-1.256-1.716h-8.8a.575.575,0,1,1,0-1.144h8.8a.575.575,0,1,1,0,1.144Z" transform="translate(-96 -64)" fill="#30c0b0"/>       </g>     </g>   </g> </svg>albums-outline:before { content: '\e801'; } /* '' */
     | ^
  59 | .icon-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="14.766" viewBox="0 0 16 14.766">   <g id="Examples" transform="translate(-246.5 -7.77)">     <g id="albums-outline" transform="translate(198.5 -56.23)">       <g id="Group_59" data-name="Group 59" transform="translate(48 67.432)">         <path id="Path_67" data-name="Path 67" d="M62.27,171.334H49.727A1.747,1.747,0,0,1,48,169.567v-7.8A1.749,1.749,0,0,1,49.727,160H62.273A1.749,1.749,0,0,1,64,161.767v7.8A1.752,1.752,0,0,1,62.27,171.334ZM49.727,161.259a.5.5,0,0,0-.5.508v7.8a.5.5,0,0,0,.5.508H62.273a.5.5,0,0,0,.5-.508v-7.8a.5.5,0,0,0-.5-.508Z" transform="translate(-48 -160)" fill="#30c0b0"/>       </g>       <g id="Group_60" data-name="Group 60" transform="translate(49.716 64)">         <path id="Path_68" data-name="Path 68" d="M113.269,80h8.883M112,81.716h11.42" transform="translate(-111.428 -79.428)" fill="#30c0b0"/>         <path id="Path_69" data-name="Path 69" d="M107.936,66.86H96.628a.575.575,0,1,1,0-1.144h11.308a.575.575,0,1,1,0,1.144Zm-1.256-1.716h-8.8a.575.575,0,1,1,0-1.144h8.8a.575.575,0,1,1,0,1.144Z" transform="translate(-96 -64)" fill="#30c0b0"/>       </g>     </g>   </g> </svg>chatbubble-outline:before { content: '\e802'; } /* '' */
  60 | .icon-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="14.766" viewBox="0 0 16 14.766">   <g id="Examples" transform="translate(-246.5 -7.77)">     <g id="albums-outline" transform="translate(198.5 -56.23)">       <g id="Group_59" data-name="Group 59" transform="translate(48 67.432)">         <path id="Path_67" data-name="Path 67" d="M62.27,171.334H49.727A1.747,1.747,0,0,1,48,169.567v-7.8A1.749,1.749,0,0,1,49.727,160H62.273A1.749,1.749,0,0,1,64,161.767v7.8A1.752,1.752,0,0,1,62.27,171.334ZM49.727,161.259a.5.5,0,0,0-.5.508v7.8a.5.5,0,0,0,.5.508H62.273a.5.5,0,0,0,.5-.508v-7.8a.5.5,0,0,0-.5-.508Z" transform="translate(-48 -160)" fill="#30c0b0"/>       </g>       <g id="Group_60" data-name="Group 60" transform="translate(49.716 64)">         <path id="Path_68" data-name="Path 68" d="M113.269,80h8.883M112,81.716h11.42" transform="translate(-111.428 -79.428)" fill="#30c0b0"/>         <path id="Path_69" data-name="Path 69" d="M107.936,66.86H96.628a.575.575,0,1,1,0-1.144h11.308a.575.575,0,1,1,0,1.144Zm-1.256-1.716h-8.8a.575.575,0,1,1,0-1.144h8.8a.575.575,0,1,1,0,1.144Z" transform="translate(-96 -64)" fill="#30c0b0"/>       </g>     </g>   </g> </svg>checkmark-done-outline:before { content: '\e803'; } /* '' */

You can download the complete CSS files from here (Click red button on right side of page).

I don't have special config for Webpack. And I'm not sure if it's related to Webpack or not. Also I tried to remove node_modules and reinstall packages but did not worked.

1

There are 1 answers

0
Joey On BEST ANSWER

I finally found the solution. The problem is with .fontello-session file. I don't know exactly what is the problem but deleting it makes everything to work again.