Warnings with Constructor Function Conversion in Astro App with React and Shadcn-ui Integration

23 views Asked by At

I've recently set up an Astro application and added React integration to it. After setting it up, I decided to incorporate Shadcn-ui into the project. I added a single Button component from Shadcn-ui to my index.astro file to test it out. Everything seemed to be working fine until I attempted to build the project using npm run build.

During the build process, I received a multitude of warnings, all pointing to a similar issue. Here's an example of one of the warnings:

dist/_astro/client.CwWKiGVO.js:25:1501 - warning ts(80002): This constructor function may be converted to a class declaration.

It appears that the build process is suggesting that some constructor functions could be converted into class declarations. I'm a bit perplexed as to why this warning is popping up, especially since it's coming from the generated client-side JavaScript file in the dist directory, and not directly from any code I wrote.

I'm curious if anyone else has encountered this issue when using Astro with React and Shadcn-ui, and if so, how you resolved it. Is there a configuration step I might have missed, or is this a known issue with a workaround? Any insights or guidance would be greatly appreciated.

Thank you in advance for your help!

0

There are 0 answers