[Bug]: next/font/local
fails to properly set paths in Storybook v7.6
#25044
Labels
next/font/local
fails to properly set paths in Storybook v7.6
#25044
Describe the bug
After upgrading to Storybook v7.6, uses of
next/font/local
have all stopped working. The paths that are being generated include the full dev path, and it is impossible to work around in a way that allows it to work on all systems.To Reproduce
Use Storybook v7.6 and the
@storybook/nextjs
package.Define local fonts in the
preview.tsx
file.According to the documentation, "[t]he path is relative to the directory where the font loader function is called." In this case, the
preview.tsx
file is in the.storybook
folder in the root of the project. In previous versions of Storybook, thepath
s above translated properly to the root:Adding a bunch of
../../../
in front of eachpath
can work, but it's system specific. In other words, if my dev directory structure is different from my coworkers, one of ours may not work depending on the depth. This is especially true in Chromatic, which is how this was initially discovered after trying the relative path approach.System
Additional context
No response
The text was updated successfully, but these errors were encountered: