Closed mririgoyen closed 9 months ago
Hi @mririgoyen Could you provide a minimal reproduction? Especially the staticDir option is relevant as well
Sure thing, here you go: https://github.com/mririgoyen/storybook-25044-reproduction
Start it up, and go to the Pages component to see the 404.
And if I pin to v7.5.3, it works:
Thanks! Fix is on its way. I will prepare a hotfix release tomorrow!
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