-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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]: Next13 aliased imports of @next/font/google fonts break the storybook #20824
Comments
Hey @andreymaslovru thanks for reporting this issue! Could you please setup a reproduction so we can better assist you?
|
I used the command above, and everything works fine, but I found what was the reason for the breakdown... be careful when calling a function call directly -> import {Roboto_Flex} from '@next/font/google' I close this issue, @yannbf thank you! |
Thanks for reporting further @andreymaslovru! I think that is a limitation and we should probably work on fixing that. @valentinpalkovic this might be related to the logic in here, given that the AST structure might be slightly different with aliased imports? https://github.com/storybookjs/storybook/blob/next/code/frameworks/nextjs/src/font/babel/helpers.ts#L284 |
@yannbf i am not sure, whether aliased imports of Google Fonts are even working in Next.js. Can you give us a feedback @andreymaslovru, whether the alias import works in Next.js directly? |
@valentinpalkovic Hey google fonts work next13 when calling alias so you can check it out i created a new commit (andreymaslovru/storybookWithNext13Issue@25ffcbb) and attach screenshots below as you can see, the font works, but the storybook doesn't start |
It would be logical if next13 would not launch the font, but it does ( |
Closing. Fixed by #24406 |
Describe the bug
When using Next13 Google fonts ('@next/font/google'), the storybook breaks. I can't use the font not in styled-components, not in the global materialUI theme. In the first case, I see an error: "Couldn't find story matching 'ui-atoms-texts-actions-textactionmiddle--common'", and in the second, an endless loader on the storybook.
To Reproduce
System
Additional context
Please note that the problem is not with local fonts - '@next/fonts/local', but with '@next/fonts/google'
How can I properly use this with a storybook? Components that are used in the storybook refer to global materialUI styles, but not working without MUI
depends: {
"next": "13.0.7",
"storybook": "^7.0.0-beta.36"
}
The text was updated successfully, but these errors were encountered: