Esri / calcite-design-system

A monorepo containing the packages for Esri's Calcite Design System
https://developers.arcgis.com/calcite-design-system/
Other
285 stars 76 forks source link

Calcite React does not work with Vite #7598

Closed mpayson closed 1 year ago

mpayson commented 1 year ago

Check existing issues

Actual Behavior

The new auto-import mechanism for calcite-react-components does not work with Vite, either with the dev server or in a production build. The components do not load, and there are import errors in the console

Note, apps can load if they import the calcite components independently, but the console errors will still be logged

Related issue for vitest that was resolved https://github.com/Esri/calcite-design-system/issues/7486

Expected Behavior

Calcite react can be used with Vite

Reproduction Sample

https://stackblitz.com/edit/vitejs-vite-1r2cnf

Reproduction Steps

  1. Open console and run app
  2. See errors in console log
  3. See button doesn't load

Also, I'm surprised that there are errors coming from trying to import many different calcite components, since only the button is used in the sample -- maybe the button is dependent on these components, or the import mechanism is trying to import all calcite components?

Screenshot 2023-08-24 at 11 32 31 AM

Reproduction Version

1.6.1

Relevant Info

No response

Regression?

1.4.3

Priority impact

p0 - emergency

Impact

I marked this as an emergency because it makes the components unusable with a common build tool, and the auto-import mechanism seems unstable, but apps may become dependent on it since it is released (let me know if this is not a correct assessment)

Calcite package

Esri team

ArcGIS Online

benelan commented 1 year ago

Hi @mpayson! We are already looking into this via #7575. Closing this one as a duplicate.