rohanray / next-fonts

Import fonts in Next.js (supports woff, woff2, eot, ttf, otf & svg)
179 stars 12 forks source link

import from external dependency fails #39

Closed jacksbox closed 3 years ago

jacksbox commented 3 years ago

I'm using nextjs with an external dependency which loads fonts via import FontA from '../../fonts/FontA.ttf' an then uses them in custom css via styled components...

sadly that breaks nextjs and I'm not able to get this working - using next-fonts I get an SyntaxError: Invalid or unexpected token error when trying to access a next page - any idea how to get this setup working with next-fonts?

rohanray commented 3 years ago

@jacksbox : Please see this example https://github.com/rohanray/next-fonts-example/tree/master/with-styled-comp

Also you can look at https://github.com/rohanray/next-fonts/issues/36

rohanray commented 3 years ago

Closing for now. @jacksbox : please create a new issue if above did not work for you