Davem M
Davem M

Reputation: 475

webpack-internal:///2:129 ag-grid: invalid gridOptions property '__ob__' did you mean any of these:

Noticed this new error in the console:

webpack-internal:///2:129 ag-grid: invalid gridOptions property '__ob__' did you mean any of these: groupSuppressBlankHeader,slaveGrids,rowData,columnDefs,excelStyles,pinnedTopRowData,pinnedBottomRowData,components
(anonymous) @ webpack-internal:///2:129

Couldn't figure it out, eventually decided to run the official Ag-Grid Vue example from:

https://github.com/ag-grid/ag-grid-vue-example

and it has the same type of errors:

webpack-internal:///2:129 ag-grid: invalid gridOptions property '__ob__' did you mean any of these: groupSuppressBlankHeader,slaveGrids,rowData,columnDefs,excelStyles,pinnedTopRowData,pinnedBottomRowData,components
(anonymous) @ webpack-internal:///2:129
webpack-internal:///2:132 ag-grid: to see all the valid gridOptions properties please check: https://www.ag-grid.com/javascript-grid-properties/
GridOptionsWrapper.checkProperties @ webpack-internal:///2:132
webpack-internal:///2:129 ag-grid: invalid colDef property '__ob__' did you mean any of these: rowGroupIndex,children,allowedAggFuncs,menuTabs,pivotTotalColumnIds,cellClassRules,icons,headerGroupComponent
(anonymous) @ webpack-internal:///2:129
webpack-internal:///2:132 ag-grid: to see all the valid colDef properties please check: https://www.ag-grid.com/javascript-grid-column-properties/
GridOptionsWrapper.checkProperties @ webpack-internal:///2:132
webpack-internal:///2:129 ag-grid: invalid colDef property '__ob__' did you mean any of these: rowGroupIndex,children,allowedAggFuncs,menuTabs,pivotTotalColumnIds,cellClassRules,icons,headerGroupComponent
(anonymous) @ webpack-internal:///2:129
webpack-internal:///2:132 ag-grid: to see all the valid colDef properties please check: https://www.ag-grid.com/javascript-grid-column-properties/
GridOptionsWrapper.checkProperties @ webpack-internal:///2:132
webpack-internal:///2:129 ag-grid: invalid colDef property '__ob__' did you mean any of these: rowGroupIndex,children,allowedAggFuncs,menuTabs,pivotTotalColumnIds,cellClassRules,icons,headerGroupComponent
(anonymous) @ webpack-internal:///2:129
webpack-internal:///2:132 ag-grid: to see all the valid colDef properties please check: https://www.ag-grid.com/javascript-grid-column-properties/
GridOptionsWrapper.checkProperties @ webpack-internal:///2:132
webpack-internal:///2:129 ag-grid: invalid colDef property '__ob__' did you mean any of these: rowGroupIndex,children,allowedAggFuncs,menuTabs,pivotTotalColumnIds,cellClassRules,icons,headerGroupComponent
(anonymous) @ webpack-internal:///2:129
webpack-internal:///2:132 ag-grid: to see all the valid colDef properties please check: https://www.ag-grid.com/javascript-grid-column-properties/

These are all in the official example repo! Suggestions??

Upvotes: 2

Views: 2367

Answers (1)

user320487
user320487

Reputation:

It's because you're passing reactive properties to gridOptions. Use Object.defineProperties or Object.defineProperty with writable false to create the options.

edit

I was able to fix the warnings using:

// gridOptions.ts
let options: GridOptions = {}

Object.defineProperty(options, 'enableFilter', {
  enumerable: true,
  value: true,
  writable: false
})

....

export default options

edit

Another thing, and this is by no means a good idea, but editing the checkProperties function in the gridOptionsWrapper class you can filter on the invalid property keys to remove __ob__:

// line 126
var invalidPropertyKeys = Object.keys(invalidProperties).filter(key => key !== '__ob__');

Upvotes: 1

Related Questions