-
-
Notifications
You must be signed in to change notification settings - Fork 29
Importing font files (*.woff, *.ttf) #15
Comments
Oops! You're totally right. I naively overwrote the storybook rule for asset compilation not realizing it also included fonts! Thanks for bringing this up. Side note, the reproduction repo link doesn't work. Are you able to provide a working link? I just want to make sure I fix your problem for sure. |
Upon further review, the next-image-loader (the loader this addon in part mimics) is configured to only take these file extensions. |
This is how storybook configures asset loaders. I’ll try to put together a minimal reproduction to exclude any other interference. |
Here's a reproduction:
StackBlitz: https://stackblitz.com/edit/nextjs-bh4hfb?file=pages/index.tsx |
Also running into a similar issue when using a custom svg webpack loader
Next.js has a check for custom svg webpack loaders here |
I was able to solve the issue with the pull request above. For anyone interested the TLDR is that after configuring the image loader for only the image types that the nextjs image loader takes, I needed to make sure that the A fix will come soon. I'm just refactoring the examples to include this case. |
@andykenward Would you mind opening an issue with your specific case and a reproduction repo? I'd love to help you out there. |
Also @czebe thanks for the reproduction repo. That was very helpful! |
🎉 This issue has been resolved in version 1.4.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Thanks Ryan! Fantastic work! |
Describe the bug
Loading fonts seems to be failing with:
Webpack config shows that the font is being loaded via
next-image-loader-stub
:Perhaps it's because font files won't have a
width
andheight
?storybook-addon-next/src/images/next-image-loader-stub.ts
Line 24 in 6583c20
Just guessing... Would love to hear your insights.
Thanks!
Your minimal, reproducible example
http://forking.example.on.codesandbox.fails.to.build
Steps to reproduce
Expected behavior
I expected static file imports to work as before, but
next-image-loader-stub
seems to be breaking.How often does this bug happen?
No response
Screenshots or Videos
No response
Platform
storybook-addon-next version
v1.3.1
Additional context
No response
The text was updated successfully, but these errors were encountered: