flekschas / svelte-simple-modal

A simple, small, and content-agnostic modal for Svelte v3 and v4

Home Page:https://svelte.dev/repl/b95ce66b0ef34064a34afc5c0249f313

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Internal server error: Failed to resolve entry for package "svelte-simple-modal". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." entry in "svelte-simple-modal" package

FluffyDiscord opened this issue · comments

commented

I had to update the plugin today, since I have been using fork, which got removed.

The following line of code throws exception an no longer works.

<script lang="ts">
    import {bind} from "svelte-simple-modal"
</script

vite: 4.0.4
svelte: 3.55.1
svelte-simple-modal: 1.6.1
@sveltejs/vite-plugin-svelte: 1.0.0-next.42
svelte-preprocess: 4.10.6

vite.config.js

import {defineConfig} from "vite"
import { svelte } from "@sveltejs/vite-plugin-svelte"
import sveltePreprocess from "svelte-preprocess"

export default defineConfig({
    plugins: [
        svelte({
            preprocess: [
                sveltePreprocess({ typescript: true }),
            ],
            hot: {
                preserveLocalState: true,
                optimistic: true
            },
        }),
    ],
    server: {
        port: 3000,
    },
    build: {
        rollupOptions: {
            input: {
                app: "./assets/app.ts",
            },
        },
    },
    resolve: {
        dedupe: ["svelte",  "svelte/transition", "svelte/internal"],
        alias: [
            {
                find: /^~.+/,
                replacement: (val) => {
                    return val.replace(/^~/, "");
                },
            },
        ],
    },
});

version 1.5.1 works fine