react-winbox icon indicating copy to clipboard operation
react-winbox copied to clipboard

Global CSS import error on NextJS

Open austinbuckler opened this issue 2 years ago • 3 comments

Screen Shot 2022-06-05 at 2 21 27 PM

I get a failed to compile error when importing react-winbox in Next.JS due to react-winbox including the base styles. Users should choose to import these base styles vs react-winbox including them by default. I can provide a PR that fixes this if you'd like.

See error here:

Global CSS cannot be imported from within node_modules.
Read more: https://nextjs.org/docs/messages/css-npm
Location: node_modules/react-winbox/dist/index.js```

austinbuckler avatar Jun 05 '22 20:06 austinbuckler

Thank you for your discovery. When I encapsulated Winbox's CSS files into this component, I didn't consider so much. At that time, my idea was that this CSS file belongs to the winbox package instead of react-Winbox. If users need to import CSS by themselves, they will have to manually install the two packages at the same time--now they only need one. Now that you have found the problem, I need to think about how to balance the two things. How about creating a copy of the relevant CSS in this project?

RickoNoNo3 avatar Jun 08 '22 14:06 RickoNoNo3

hi @RickoNoNo3 @austinbuckler, any fix for this?

sugamkarki avatar Aug 07 '22 17:08 sugamkarki

@sugamkarki I'm new to NextJS still now, is my previous proposal feasible? It will be fixed for soon if possible.

RickoNoNo3 avatar Aug 08 '22 02:08 RickoNoNo3