rohanray / next-fonts

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

Compile Error after upgrade from next-font 1.2 to 1.3 #33

Closed scurrilus-funke closed 4 years ago

scurrilus-funke commented 4 years ago

Hi,

After upgrade from 1.2 to 1.3 i get this Error. Is it possible that someone explain it? With 1.2 everything works fine

error - ./fonts/fira-sans/fira-sans-v10-latin-italic.woff2 1:4 Module parse failed: Unexpected character '' (1:4) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders (Source code omitted for this binary file) wait - compiling...

best Peter

lorefnon commented 4 years ago

I think the recently updated regex here should have query part optional:

-      let testPattern = /\.(woff(2)?|eot|ttf|otf)(\?v=\d+\.\d+\.\d+)$/;
+      let testPattern = /\.(woff(2)?|eot|ttf|otf)(\?v=\d+\.\d+\.\d+)?$/;
rohanray commented 4 years ago

@scurrilus-funke : Please upgrade to 1.4.0. thanks @lorefnon for identifying the bug. -RR