Chonky icon indicating copy to clipboard operation
Chonky copied to clipboard

Icons size is zero after page transitions in next.js

Open romikforest opened this issue 2 years ago • 1 comments

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 avatar Mar 28 '23 23:03 romikforest

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;

romikforest avatar Apr 04 '23 01:04 romikforest