You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are having a hard time with these imports. As mostly falls back to CJS.
To force ESM we tried a few imports:
import DateTimePicker, { DateTimePickerProps } from 'react-datetime-picker'; <-- returns CJS
import DateTimePicker, { DateTimePickerProps } from 'react-datetime-picker/dist/esm';
import DateTimePicker, { DateTimePickerProps } from 'react-datetime-picker/dist/esm/DateTimePicker';
import DateTimePicker, { DateTimePickerProps } from 'react-datetime-picker/dist/esm/DateTimePicker.js';
import DateTimePicker, { DateTimePickerProps } from 'react-datetime-picker/dist/esm/index.js';
Right now, vitest can't handle it, and it's returning the following error: Error: Missing "./dist/esm/DateTimePicker.js" specifier in "react-datetime-picker" package
Also, looking at your package.json exports, I see the following:
This makes me wonder if you shouldn't being explicitly exporting the DateTimePicker instead of DateTimeInput?
Especially because the latter is a dependency of the former.
Would appreciate any help folks! :)
The text was updated successfully, but these errors were encountered:
I also can't understand why would 'react-datetime-picker' resolve to CJS, if import comes before require.
As for the explicit import of DateTimeInput, it's there to support @wojtekmaj/react-datetimerange-picker which uses components of this package internally :) You're not supposed to use these, it's not documented anywhere. I mean you can, it's not that open source police will come to your door, but I see no reason to. :D
We are having a hard time with these imports. As mostly falls back to CJS.
To force ESM we tried a few imports:
Right now,
vitest
can't handle it, and it's returning the following error:Error: Missing "./dist/esm/DateTimePicker.js" specifier in "react-datetime-picker" package
Also, looking at your
package.json
exports, I see the following:This makes me wonder if you shouldn't being explicitly exporting the
DateTimePicker
instead ofDateTimeInput
?Especially because the latter is a dependency of the former.
Would appreciate any help folks! :)
The text was updated successfully, but these errors were encountered: