You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to some reasons the compiled components of Pattenfly-React do not include related CSS. This causes problems with using this components library with some SSR frameworks like NextJS.
According to NextJS docs this problem must be solved by a maintainer:
Actual behavior:
Initial installation of patternfly-react in NextJS app causes CSS Modules Imported by a Dependency error while running next dev and opening localhost:3000. Such behavior is OS independent. To solve this issue (by a kludge solution) you must install webpack@4 as devDependency and use custom next.config.js:
Unfortunately the performance with custom next.config.js in development is very poor. In this case, as I understand it, the node process starts rebuilding the whole patternfly library with current project on every render/rerender which causes high CPU and RAM usage:
This time around 40-60% CPU load and 1-1.5 GB of RAM are required. The first compilation may take about 4 minutes.
A couple of times the node process even crashed with GC report. I believe that this behavior not suits for development. This happens only in development mode: in production mode after next build there are no such problems.
I know that this issue duplicates #4125, but it closed. There were no reply from NextJS devs as well in vercel/next.js#20916.
Please give a reply about this issue.
The text was updated successfully, but these errors were encountered:
It would be a breaking change to support Next.js since the default way we support importing styles is importing only what you need via import './component.css';. We chose that to produce lightweight bundles since patternfly.css weighs in at nearly 1MB but most consumers don't use all of it.
Due to some reasons the compiled components of Pattenfly-React do not include related CSS. This causes problems with using this components library with some SSR frameworks like NextJS.
According to NextJS docs this problem must be solved by a maintainer:
Actual behavior:
Initial installation of patternfly-react in NextJS app causes CSS Modules Imported by a Dependency error while running
next dev
and openinglocalhost:3000
. Such behavior is OS independent. To solve this issue (by a kludge solution) you must install webpack@4 as devDependency and use customnext.config.js
:Unfortunately the performance with custom
next.config.js
in development is very poor. In this case, as I understand it, the node process starts rebuilding the whole patternfly library with current project on every render/rerender which causes high CPU and RAM usage:This time around 40-60% CPU load and 1-1.5 GB of RAM are required. The first compilation may take about 4 minutes.
A couple of times the node process even crashed with GC report. I believe that this behavior not suits for development. This happens only in development mode: in production mode after
next build
there are no such problems.I know that this issue duplicates #4125, but it closed. There were no reply from NextJS devs as well in vercel/next.js#20916.
Please give a reply about this issue.
The text was updated successfully, but these errors were encountered: