Skip to content
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

Icons size is zero after page transitions in next.js #185

Open
romikforest opened this issue Mar 28, 2023 · 1 comment
Open

Icons size is zero after page transitions in next.js #185

romikforest opened this issue Mar 28, 2023 · 1 comment

Comments

@romikforest
Copy link

romikforest commented Mar 28, 2023

Hi. I'm trying to use chonky in next.js and have a strange problem. Sorry I haven't done a simplified example.

It works perfectly after the page full refresh. But if I have a page transition to another next.js route or come from another route without full refresh all chonky icons disappear. That is they exists, but their size is zero. I explored the page DOM. The span.MuiButton-label still has size 14x30 but some inline classes for svg like svg-inline--fa fa-level-up-alt fa-w-10 fa-fw don't have definitions any more after page transitions.
I played a lot with my app but couldn't so anything with this behaviour.
Are there some ideas why it can be so?

Chonky 2.3.2

@romikforest
Copy link
Author

romikforest commented Apr 4, 2023

As a possible solution:

Add to css:
@import '@fortawesome/fontawesome-svg-core/styles.css'

Add to _app.ts:

import { config as faConfig } from '@fortawesome/fontawesome-svg-core';
faConfig.autoAddCss = false;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant