myliang/x-spreadsheet

[Error] Uncaught TypeError: Cannot read properties of undefined (reading 'addEventListener')

Opened this issue · 0 comments

I got error when first time try using this lib with Svelte framework.

<script lang="ts">
import { onMount } from 'svelte';
import Spreadsheet from "x-data-spreadsheet";

export let sheetInstance: Spreadsheet = Object.create(null);

let tableElement: HTMLElement;

onMount(() => {
    console.log(sheetInstance);
    sheetInstance = new Spreadsheet(tableElement, {
        
    });
    sheetInstance.loadData({});
    console.log(sheetInstance);
});

</script>

<!-- The View -->
<div bind:this={tableElement}></div>

<!-- CSS -->
<style lang="scss">

</style>

Any idea what's causing this?