nathanreyes / v-calendar

An elegant calendar and datepicker plugin for Vue.
https://vcalendar.io
MIT License
4.39k stars 859 forks source link

"export 'default' (imported as 'DatePicker') was not found in 'v-calendar/lib/components/date-picker.umd' #581

Open aligajani opened 4 years ago

aligajani commented 4 years ago

Using following webpack.js I get the below warning:

WARNING in ./resources/js/pages/profile/ProfileEdit.vue?vue&type=script&lang=js& (./node_modules/babel-loader/lib??ref--4-0!./node_modules/babel-loader/lib??ref--11-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/pages/profile/ProfileEdit.vue?vue&type=script&lang=js&) 316:16-26
"export 'default' (imported as 'DatePicker') was not found in 'v-calendar/lib/components/date-picker.umd'
 @ ./resources/js/pages/profile/ProfileEdit.vue?vue&type=script&lang=js&
 @ ./resources/js/pages/profile/ProfileEdit.vue
 @ ./resources/js/router/ProfileRoutes.js
 @ ./resources/js/routes.js
 @ ./resources/js/app.js
 @ multi ./resources/js/app.js ./resources/theme/scss/theme.scss

WARNING in ./resources/js/pages/aml/submission/AMLSubmissionForm.vue?vue&type=script&lang=js& (./node_modules/babel-loader/lib??ref--4-0!./node_modules/babel-loader/lib??ref--11-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/pages/aml/submission/AMLSubmissionForm.vue?vue&type=script&lang=js&) 229:16-26
"export 'default' (imported as 'DatePicker') was not found in 'v-calendar/lib/components/date-picker.umd'
 @ ./resources/js/pages/aml/submission/AMLSubmissionForm.vue?vue&type=script&lang=js&
 @ ./resources/js/pages/aml/submission/AMLSubmissionForm.vue
 @ ./node_modules/babel-loader/lib??ref--4-0!./node_modules/babel-loader/lib??ref--11-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/pages/aml/submission/AMLSubmissionIndex.vue?vue&type=script&lang=js&
 @ ./resources/js/pages/aml/submission/AMLSubmissionIndex.vue?vue&type=script&lang=js&
 @ ./resources/js/pages/aml/submission/AMLSubmissionIndex.vue
 @ ./resources/js/router/AMLRoutes.js
 @ ./resources/js/routes.js
 @ ./resources/js/app.js
 @ multi ./resources/js/app.js ./resources/theme/scss/theme.scss

Only happens when I have this included:

.webpackConfig({
        module: {
            rules: [
                {
                    test: /\.jsx?$/,
                    exclude: /(bower_components)/,
                    use: [
                        {
                            loader: 'babel-loader',
                            options: Config.babel()
                        }
                    ]
                }
            ]
        }
    });

PS: I am using laravel-mix-polyfill version ^2.0.0

samiam9297 commented 4 years ago

https://vcalendar.io/installation.html

See steps 1 and 2A. Works fine for me on Laravel.

aligajani commented 4 years ago

I get this "export 'default' (imported as 'DatePicker') was not found in 'v-calendar/lib/components/date-picker.umd' while using 1.0.0-beta.22

samiam9297 commented 4 years ago

NPM install (Docs: 1) npm install v-calendar@next

main.js (plugin method) (Docs: 2A)

// V-Calendar
import VCalendar from 'v-calendar';
Vue.use(VCalendar, {
    componentPrefix: 'vc',
});

app.vue

//...

<div>
    <vc-date-picker
        :value="null"
        is-expanded
        is-inline
    />
</div>

//...
christophermiles commented 4 years ago

I'm following this method (because I was having the same issue with importing components being reported at https://github.com/nathanreyes/v-calendar/issues/502) and still getting errors

demonxian3 commented 4 years ago

Solutions used by myself

npm remove v-calender
npm i v-calendar@1.0.0-beta.22

and then, it work