svelte-datepicker icon indicating copy to clipboard operation
svelte-datepicker copied to clipboard

Problem with dayjs in Svelte 3

Open risalfajar opened this issue 3 years ago • 1 comments

Hello, I'm using this DatePicker for Svelte (not Svelte-kit) project with Vite. However the browser's console print this error:

Uncaught (in promise) SyntaxError: The requested module '/node_modules/dayjs/plugin/isSameOrAfter.js?v=493692cb' does not provide an export named 'default'

My vite.config.js:

import {svelte} from '@sveltejs/vite-plugin-svelte'
import {defineConfig} from 'vite'
import {minify} from 'html-minifier'

const minifyHtml = () => {
    return {
        name: 'html-transform',
        transformIndexHtml(html) {
            return minify(html, {
                collapseWhitespace: true,
            })
        },
    }
}

module.exports = defineConfig(({mode}) => {
    const isProduction = mode === 'production'

    return {
        optimizeDeps: {
            exclude: ['@roxi/routify'],
        },
        plugins: [svelte(), isProduction && minifyHtml()],
        build: {
            minify: isProduction,
        },
    }
})

Is there any solution for this?

risalfajar avatar Jun 02 '22 16:06 risalfajar

https://github.com/beyonk-adventures/svelte-datepicker/issues/61

Its-Just-Nans avatar Aug 29 '22 18:08 Its-Just-Nans