Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with dayjs in Svelte 3 #59

Open
risalfajar opened this issue Jun 2, 2022 · 1 comment
Open

Problem with dayjs in Svelte 3 #59

risalfajar opened this issue Jun 2, 2022 · 1 comment

Comments

@risalfajar
Copy link

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?

@Its-Just-Nans
Copy link

#61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants