mengxiong10 / vue-datepicker-next

A datepicker / datetimepicker component for Vue3
https://mengxiong10.github.io/vue-datepicker-next/
MIT License
147 stars 34 forks source link

[1.0.3] TypeError: r.default.locale is not a function #49

Open susanne99 opened 11 months ago

susanne99 commented 11 months ago

i use vue-datepicker-next: 1.0.3 vue: 3.3.4 vite: 4.3.9

the runtime error occurs only in production mode : npm run build -> "build": "run-p type-check build-only",

when i deploy the "dist" folder to the production machine, then this is error occurs in the browser console TypeError: r.default.locale is not a function

the line " return r.default.locale("de", l)," causes this error

(function(t, e) {
    (function(n, a) {
        t.exports = a(Da)
    }
    )(It, function(n) {
        function a(s) {
            return s && typeof s == "object" && "default"in s ? s : {
                default: s
            }
        }
        var r = a(n)
          , o = {
            months: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"],
            monthsShort: ["Jan", "Feb", "März", "Apr", "Mai", "Juni", "Juli", "Aug", "Sep", "Okt", "Nov", "Dez"],
            weekdays: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"],
            weekdaysShort: ["So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."],
            weekdaysMin: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"],
            firstDayOfWeek: 1,
            firstWeekContainsDate: 4
        };
        const l = {
            formatLocale: o,
            yearFormat: "YYYY",
            monthFormat: "MMM",
            monthBeforeYear: !0
        };
        return r.default.locale("de", l),
        l
    })
}
)(wa);
export {ya as i};

here my code snippet:

import DatePicker from 'vue-datepicker-next'
import 'vue-datepicker-next/locale/de'

  <date-picker
        :id="uuid + 'birthdate'"
        size="sm"
        value-type="YYYY-MM-DD"
        format="DD.MM.YYYY"
        title-format="DD.MM.YYYY"
        :disabled-date="disabledBirthdateRange"
        v-model:value="v$.formdata.birthdate.$model"
        :aria-describedby="uuid + 'birthdate_feedback'">
    </date-picker>
mengxiong10 commented 11 months ago

https://github.com/mengxiong10/vue-datepicker-next/issues/30#issuecomment-1418909431