vaheqelyan / svelte-grid

A responsive, draggable and resizable grid layout, for Svelte. [NOT MAINTAINED]
https://svelte-grid.now.sh/
MIT License
970 stars 58 forks source link

"Uncaught TypeError: undefined is not a function" in <MoveResize cols={getComputedCols} #66

Closed frantic0 closed 3 years ago

frantic0 commented 3 years ago

Hi @vaheqelyan

I am trying to update to svelte-grid v.3.5.1. I've found your issue https://github.com/vaheqelyan/svelte-grid/issues/54 and am upgrading accordingly (refactoring grid-items, breakpoints to cols, etc).

However, there is a runtime an error preventing svelte-grid from loading, even without any items.

index.svelte:26 Uncaught (in promise) TypeError: undefined is not a function
    at Object.$$self.$$.update (index.svelte:26)
    at init (index.mjs:1396)
    at new Src (index.svelte:43)

where index.svelte:26 is

<MoveResize ...  
   cols={getComputedCols}

where index.svelte:43 is

  import { debounce, getColumn } from "./utils/other.js";
//line 43
  import MoveResize from "./MoveResize/index.svelte";

so getComputedCols is undefined on load.

Do you have any suggestion on how I can fix this?

Many thanks

vaheqelyan commented 3 years ago

Can I see your full stack trace ? it won't be easy for me to tell what's wrong with the component. https://github.com/vaheqelyan/svelte-grid/blob/master/src/index.svelte#L105 have you provided breakpoints ?

frantic0 commented 3 years ago

oh no, I found that it was the old gap parameter value that was causing a type error (integer rather than a list)...