Storybook Question: Local fonts not loading – Next 13 + Tailwind + Storybook 7 – Storybook

by
Alexei Petrov
fonts next.js storybook tailwind-css

Quick Fix: In Storybook’s ".storybook/preview.tsx" file, ensure that the paths to local fonts in the "next/font/local" definition use the correct relative path to the fonts directory within the Storybook runtime environment.

The Problem:

When Nextjs is being used in conjunction with Storybook, local fonts are not loading in Storybook while the regular Nextjs development environment works perfectly

Q&A

Local fonts fail to load in Storybook.

File name with blankspace may cause the issue.

Font variable missing even after setting up CSS variable?

Renamed font files without blankspace, solved the issue.

Video Explanation:

The following video, titled "How To Create An Advanced Shopping Cart With React and ...", provides additional insights and in-depth exploration related to the topics discussed in this post.

Play video

my best trick of learning is by putting the video at a speed of 0.75 then putting youtube on one side of my window and on the other side my ...