Hello, and thank you for your work on this library 👋
There appears to be an issue with importing locales as documented when using this library with the latest Vite 8 setup. For example, the following would result in the default ru locale being used even though the en locale is explicitly specified:
import AirDatepicker from 'air-datepicker';
import localeEn from 'air-datepicker/locale/en';
new AirDatepicker('#el', {
locale: localeEn
});
The locale import seems to be resolving with the entire module.exports object rather than the default value, so a workaround of using localeEn.default in the above example addresses the issue.
A reproduction with a basic Vite 8 setup can be found here:
https://stackblitz.com/edit/vitejs-vite-hqegby8b?file=src%2Fmain.js
It looks like Vite 8 introduced consistent CommonJS interop handling via Rolldown which appears to affect this library, see:
Hello, and thank you for your work on this library 👋
There appears to be an issue with importing locales as documented when using this library with the latest Vite 8 setup. For example, the following would result in the default
rulocale being used even though theenlocale is explicitly specified:The locale import seems to be resolving with the entire
module.exportsobject rather than thedefaultvalue, so a workaround of usinglocaleEn.defaultin the above example addresses the issue.A reproduction with a basic Vite 8 setup can be found here:
https://stackblitz.com/edit/vitejs-vite-hqegby8b?file=src%2Fmain.js
It looks like Vite 8 introduced consistent CommonJS interop handling via Rolldown which appears to affect this library, see: