-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Breaks the nextJs localFonts #21
Comments
Any update on this? This issue still exists 😢 |
Same problem. Impossible to run the Storybook / CI tests with Next.js due to this issue. |
Hey everyone! Would you mind providing a reproduction I could take a look at? Thank you! |
Hello, having the same issue. For reproduction I think it's enough just to start a NextJS project, import some font from @next/font/google, add storybook, add coverage addon and run storybook. Anyone has a workaround in the mean time' Thanks! |
@yannbf I created a minimal reproduction here: https://github.com/nschikora/next-storybook-coverage Let me know if I can be of help and thank you a lot for looking into this. |
Thank you so so much for your repro @nschikora! We have to take a look into dozens of issues all the time, so having to create repros ourselves makes things harder to take a look at. Sharing a repro like you did is incredibly helpful. I took a look at it seems like the local font import is not instrumented: Nextjs has internal plugins to transform the font imports, it should have looked more like this: It seems like Nextjs just doesn't work with babel based configurations + coverage:
|
any update on this? I would really like to introduce coverage to my stories. |
Any update @yannbf, @valentinpalkovic? |
Could you all try to use the canary version of |
I tested it with @nschikora's repo: https://github.com/nschikora/next-storybook-coverage It is resolved I think, but not sure completely since I did not execute |
Can confirm that it works now. Thank you a lot @yannbf and @valentinpalkovic. |
https://github.com/storybookjs/addon-coverage/releases/tag/v1.0.0 is released and fixes the issue. You can now use it instead of the canary release! |
When the addon is included the story book shows an error localFont is not defined
Steps to reproduce the behavior
Expected behavior
It should include the local fonts
Screenshots and/or logs
Environment
Additional context
package versions
"next": "^13.4.2",
"@storybook/addon-coverage": "^0.0.8",
"@storybook/nextjs": "^7.0.12",
The text was updated successfully, but these errors were encountered: