You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to get light-table working on, I copied the example from the demo page, but when I try to run this, I got an error from console:
Table.js:433 Uncaught TypeError: Cannot read property 'map' of null
at Function.createRows (Table.js:433)
at new Table (Table.js:104)
at Class.init (table-component.js:29)
at Class.superWrapper [as init] (ember.debug.js:40426)
at new Class (ember.debug.js:36118)
at Function._ClassMixinProps.create (ember.debug.js:36306)
at CurlyComponentManager.create (ember.debug.js:12594)
at OpenComponentOpcode.evaluate (ember.debug.js:47194)
at VM.execute (ember.debug.js:53785)
at Object.render (ember.debug.js:53348)
It is pointing at line 29 in table-component, which is right above the init() function. However, if I manually supply data to model, it works fine. If I set model: [] instead of model: null, it works...
@zuekut as you can see in the code excerpt above, model—which is passed to the Table constructor as the columns array—is null when init is run. Since ELT tries to call columns.map( ... ) you get that error. To fix it, make sure the values you pass to the Table constructor (i.e. columns and rows) are arrays.
We could add assertions to the constructor that print more detailed instructions. The current error message is admittedly a bit cryptic.
buschtoens
changed the title
map of null
TypeError: Cannot read property 'map' of null
Nov 14, 2017
Hi,
I am trying to get light-table working on, I copied the example from the demo page, but when I try to run this, I got an error from console:
It is pointing at line 29 in
table-component
, which is right above theinit()
function. However, if I manually supply data tomodel
, it works fine. If I setmodel: []
instead ofmodel: null
, it works...The text was updated successfully, but these errors were encountered: