Skip to content

Does not work with NextJS due to Next not supporting global CSS files #383

Closed
@UlyssesInvictus

Description

@UlyssesInvictus

The current installation for this library recommends direct import of the styles library as a global CSS file.

However, some frameworks like NextJS forbid this methodology, throwing the following error:

Global CSS cannot be imported from within node_modules.
Read more: https://err.sh/next.js/css-npm

(More about this practice in NextJS can be found in this thread).

Is it possible to update the library so that style is automatically injected into the component? I understand why the styles are exported separately (to support themes), but in our case we cannot use the recommended solution of manually exporting the library styles from _app.js.

In my project's particular case, we are resorting to manually copying the styles from this lib and injecting them in our project location, but this is not ideal, so alternate solutions would be helpful. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions