Skip to content

svelte-table impacted by bug in Svelte > 3.39.0 #68

Closed
@wtfiwtz

Description

@wtfiwtz

The distribution versions of svelte-table are compiled with svelte > 3.39.0 which has this issue:

sveltejs/svelte#6584
Introduced here: sveltejs/svelte#5870

The easiest workaround I found was to directly import the .svelte file. Change:
import SvelteTable from "svelte-table";
to
import SvelteTable from "svelte-table/src/SvelteTable.svelte";

This gets around the use of the dist/ folder versions in the NPM package.

Here's where you can hack the dist/es/SvelteTable.mjs file to confirm:

function Y(t, n, c, s, r, a, i, d = [-1]) {
    const u = O;
    S(t);
    const f = t.$$ = {
        fragment: null,
        ctx: null,
        props: a,
        update: e,
        not_equal: r,
        bound: o(),
        on_mount: [],
        on_destroy: [],
        on_disconnect: [],
        before_update: [],
        after_update: [],
        context: new Map(n.context || (u ? u.$$.context : [])),
        callbacks: o(),
        dirty: d,
        skip_bound: !1,
        root: n.target || (u && u.$$.root)
    };

... to add u && u.$$.root. This is be the parent_component pointer is not checked - see sveltejs/svelte@5cfefeb#diff-da9bae4e28c441de5ba3a074e30775fe69109100b3d921ad8f2592d93cd67b7fR133.

The error is:

SvelteTable.mjs:404 
Uncaught TypeError: Cannot read properties of undefined (reading '$$')
    at Y (SvelteTable.mjs:404)
    at new Ce (SvelteTable.mjs:1411)
    at Array.create_default_slot_13 (Board.svelte:138)
    at create_slot (index.mjs:141)
    at create_fragment (CardBody.svelte:2)
    at init (index.mjs:2129)
    at new CardBody (CardBody.svelte:7)
    at Array.create_default_slot_12 (Board.svelte:138)
    at create_slot (index.mjs:141)
    at create_fragment (Card.svelte:2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions