turbo icon indicating copy to clipboard operation
turbo copied to clipboard

[Turbopack] Breaks @next/font/local

Open kalm42 opened this issue 3 years ago • 1 comments

What version of Turborepo are you using?

default for next 13

What package manager are you using / does the bug impact?

npm

What operating system are you using?

Mac

Describe the Bug

@next/font/local is broken with turbo. I get only an error from the @next/font library. "Error: @next/font/local failed to run or is incorrectly configured." I'm reporting it here because when I take off --turbo from the dev script everything works fine.

Expected Behavior

No error.

To Reproduce

  • new install of next 13
  • install dep @next/font
  • add layout file
  • import localFont from '@next/font/local'
  • copy any font to same file location ./app/cool-font.woff
  • Import the font as per instructions here
  • add page file with any text just for testing purposes
  • update package.json > scripts > dev: to use turbo
  • run

Reproduction Repo

No response

kalm42 avatar Oct 29 '22 19:10 kalm42

Please let me know if I can be of any assistance. I would love the opportunity to help solve this bug I just don't know where to look next.

kalm42 avatar Oct 29 '22 19:10 kalm42

Hey y'all, we're aware of this limitation. If you look very closely you'll see that we throw an error message about this support. We look forward to bringing support for this very soon!

https://github.com/vercel/turbo/blob/4c5cab2755444fd60aa91aaba798473e58de117b/crates/turbopack/src/lib.rs#L66-L67

#2545 and #2494 are both reporting the same thing. At this point it's not exactly a bug, more a known limitation, and internally we're tracking toward implementing it. @wbinnssmith is the person currently investigating it. 🔜

In the mean time this is a possible workaround to enable using fonts with Turbopack: https://nextjs.org/docs/messages/no-page-custom-font#possible-ways-to-fix-it

nathanhammond avatar Nov 03 '22 05:11 nathanhammond

Thank you for taking the time to let me know I really appreciate it. @wbinnssmith If I can be of any assistance please let me know.

kalm42 avatar Nov 03 '22 21:11 kalm42

oh.. I have same issue

po4tion avatar Nov 29 '22 02:11 po4tion