3

I've found loads of questions on this, but none of the answers are working..

I'm trying to import a font from node modules from this package into a Create React app

I've managed to get it compile with

@import './../node_modules/roboto-fontface/css/roboto/sass/roboto-fontface.scss';

however as soon as I run it I get

Module not found: You attempted to import ../../../fonts/roboto/Roboto-Black.eot
 which falls outside of the project src/ directory. Relative imports outside of
src/ are not supported. You can either move it inside src/, or add a symlink to
it from project's node_modules/.

I've tried with ~, node_modules and various other ways of getting it into the project. Any clues?

beek
  • 3,522
  • 8
  • 33
  • 86

1 Answers1

2

I would create a assets/fonts/ directory inside src/ and put the fonts there :). Give it a try!

Luis Gurmendez
  • 654
  • 4
  • 10