stream-chat-react icon indicating copy to clipboard operation
stream-chat-react copied to clipboard

Fix build warnings

Open petyosi opened this issue 3 years ago • 6 comments

Motivation Running the usual build results in a bunch of warnings, most likely related to our umd bundles.

Acceptance Criteria Build should pass with no warnings.

petyosi avatar Mar 04 '22 11:03 petyosi

I don't know if it happens to you but when compiling with Vite I get the following warning since the beginning of time when compiling stream-chat-react styles image

ivanrosvimi avatar Sep 09 '22 07:09 ivanrosvimi

Any update?

ivanrosvimi avatar Oct 14 '22 09:10 ivanrosvimi

@ivanrosvimi this is not a known problem. The task in question is related to the build warnings themselves. Can you reproduce this somewhere? We have a few vite test cases, but none of them causes that.

petyosi avatar Oct 14 '22 10:10 petyosi

It's happening to us even having the last version. It's related to the css/scss import: import 'stream-chat-react/dist/css/v2/index.css'; OR import 'stream-chat-react/dist/scss/v2/index.scss'; and running npm start or npm run build displays that warning. Maybe you don't have the styling import in your vite example

ivanrosvimi avatar Oct 14 '22 12:10 ivanrosvimi

Isn't this solving your problem? https://github.com/vitejs/vite/discussions/5079

petyosi avatar Oct 14 '22 17:10 petyosi

I have already tried to put the line css: { preprocessorOptions: { css: { charset: false } } } in the vite.conf file without effect. Anyway, your library is the only one in which the warning appears when compiling the application with vite.

ivanrosvimi avatar Oct 17 '22 07:10 ivanrosvimi

@ivanrosvimi I tested the setup in this stackblitz. I can't see any warnings in the terminal there. What am I missing?

petyosi avatar Oct 18 '22 09:10 petyosi

Yes, you are right. I have been testing your StackBlitz and seeing what could happen with our code as it is quite similar. Investigating in the Vite issues and looking at their changelogs it is something that they fixed from 2.9.2 by hoisting to the chatset of the styles: https://github.com/vitejs/vite/blob/v2.9.15/packages/vite/CHANGELOG.md#292-2022-04-13.

Thank you very much for your time and sorry for not having seen it on our own.

ivanrosvimi avatar Oct 18 '22 09:10 ivanrosvimi

The warnings have been fixed

MartinCupela avatar Feb 12 '24 13:02 MartinCupela