Date type column does let paste values when copy pasting data angular version issue

Tags: #<Tag:0x00007efc6dbe8190>

I am using angular 11.2.8 and if my handsonlibrary latest version which is 11.0.1 then i get following error

core.js:6210 ERROR Error: You declared cell type "date" as a string that is not mapped to a known object.
                 Cell type must be an object or a string mapped to an object registered by
                 "Handsontable.cellTypes.registerCellType" method
    at _getItem (registry.mjs:22)
    at expandMetaType (utils.mjs:17)
    at ColumnMeta.updateMeta (columnMeta.mjs:82)
    at MetaManager.updateColumnMeta (index.mjs:157)
    at Core.updateSettings (core.mjs:2442)
    at Core.init (core.mjs:1115)
    at handsontable-angular.js:208
    at ZoneDelegate.invoke (zone-evergreen.js:372)
    at Zone.run (zone-evergreen.js:134)
    at NgZone.runOutsideAngular (core.js:28520)



but if handsontable version ^10.0.0 i get following error 

zone.js:192 Uncaught TypeError: Cannot read properties of null (reading 'destroy')
    at n.value (handsontable.full.min.js:623)
    at n.value (handsontable.full.min.js:623)
    at n.value (handsontable.full.min.js:623)
    at Object.l.onQueueEmpty (handsontable.full.min.js:501)
    at Object.checkIfQueueIsEmpty (handsontable.full.min.js:501)
    at Object.removeValidatorFormQueue (handsontable.full.min.js:501)
    at eval (handsontable.full.min.js:501)
    at a (handsontable.full.min.js:501)
    at eval (handsontable.full.min.js:501)
    at n.u [as validator] (handsontable.full.min.js:629)
value @ handsontable.full.min.js:623
value @ handsontable.full.min.js:623
value @ handsontable.full.min.js:623
l.onQueueEmpty @ handsontable.full.min.js:501
checkIfQueueIsEmpty @ handsontable.full.min.js:501
removeValidatorFormQueue @ handsontable.full.min.js:501
eval @ handsontable.full.min.js:501
a @ handsontable.full.min.js:501
eval @ handsontable.full.min.js:501
u @ handsontable.full.min.js:629
eval @ handsontable.full.min.js:501
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:495
ZoneTask.invoke @ zone.js:484
timer @ zone.js:2065
(anonymous) @ webcontainer.fc4d7a197ee1a758c28dc4fa30e0985945a0859e.js:15
u @ webcontainer.fc4d7a197ee1a758c28dc4fa30e0985945a0859e.js:15
r @ webcontainer.fc4d7a197ee1a758c28dc4fa30e0985945a0859e.js:15
postMessage (async)
n @ webcontainer.fc4d7a197ee1a758c28dc4fa30e0985945a0859e.js:15
c.setImmediate @ webcontainer.fc4d7a197ee1a758c28dc4fa30e0985945a0859e.js:15
scheduleTask @ zone.js:2087
ZoneDelegate.scheduleTask @ zone.js:407
Zone.scheduleTask @ zone.js:232
Zone.scheduleMacroTask @ zone.js:255
eval @ zone.js:2103
proto.<computed> @ zone.js:1382
_registerImmediate @ handsontable.full.min.js:501
validateCell @ handsontable.full.min.js:501
te @ handsontable.full.min.js:501
setDataAtCell @ handsontable.full.min.js:501
populateFromArray @ handsontable.full.min.js:501
populateFromArray @ handsontable.full.min.js:501
value @ handsontable.full.min.js:629
value @ handsontable.full.min.js:629
eval @ handsontable.full.min.js:629
t.fastCall @ handsontable.full.min.js:55
runLocalHooks @ handsontable.full.min.js:64
eval @ handsontable.full.min.js:629
i @ handsontable.full.min.js:55
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:495
invokeTask @ zone.js:1536
globalZoneAwareCallback @ zone.js:1573

my settings for table are like these

  hotSettings: Handsontable.GridSettings = {
    manualRowResize: true,
    manualColumnResize: true,
    columns: [{
      title: 'Date',
      type: 'date',
      allowInvalid: true,
      correctFormat: true,
      dateFormat: 'DD.MM.YYYY',
      allowEmpty: true,


    }],
    startRows: 5,
    rowHeaders: true,
    height: 'auto',
    licenseKey: 'non-commercial-and-evaluation',
    allowRemoveRow: true,
    outsideClickDeselects: false,
  };

what can be done here to avoid such things @adrian.szymanski
thanks in advance

Hi @talhach891

I tried to reproduce your issue locally and on jsfiddle but I wasn’t able to get any errors with the settings that you provided. Can you please tell me if are there any other operations that you do?

@adrian.szymanski this is stackblitz link pelase follow that and i am attaching a file for data please copy the data from from file and paste in date column it throws some error

Uncaught TypeError: Cannot read properties of null (reading ‘destroy’)
at n.value (handsontable.full.min.js:623)
at n.value (handsontable.full.min.js:623)
at n.value (handsontable.full.min.js:623)
at Object.l.onQueueEmpty (handsontable.full.min.js:501)
at Object.checkIfQueueIsEmpty (handsontable.full.min.js:501)
at Object.removeValidatorFormQueue (handsontable.full.min.js:501)
at eval (handsontable.full.min.js:501)
at a (handsontable.full.min.js:501)
at eval (handsontable.full.min.js:501)
at n.u [as validator] (handsontable.full.min.js:629)

please use data from this file

you can see the error here in this image

@aleksandra_budnik can you please look it too

Hi @talhach891

Please update to Handsontable v11 and check if the issue persists. I have reported this issue here https://github.com/handsontable/handsontable/issues/8894 and our developers already fixed it (it was a regression in v10).

hi @aleksandra_budnik thanks for quick reply as mentioned earlier on 11.0.0 or 11.0.1 i am getting following error in my case i don’t have data user paste their content on page

ERROR Error: You declared cell type "date" as a string that is not mapped to a known object.
             Cell type must be an object or a string mapped to an object registered by
             "Handsontable.cellTypes.registerCellType" method
at _getItem (registry.mjs:22)
at expandMetaType (utils.mjs:17)
at ColumnMeta.updateMeta (columnMeta.mjs:82)
at MetaManager.updateColumnMeta (index.mjs:157)
at Core.updateSettings (core.mjs:2442)
at Core.init (core.mjs:1115)
at handsontable-angular.js:208
at ZoneDelegate.invoke (zone-evergreen.js:372)
at Zone.run (zone-evergreen.js:134)
at NgZone.runOutsideAngular (core.js:28520)

Hi @talhach891

the issue is gone when I update the dependencies https://jsfiddle.net/4qL3tkrh/

@aleksandra_budnik i think you are using angular 8 and i am using angular 11 and later on we will move it to 12 can you please check this stackblitz with angular 11 its not compiling and throws same error

Thank you for sharing. My colleague’s testing the code and we will update the thread later today,

Hi @talhach891

I tested your case locally (using Angular 11 and HOT 11.0.1) and indeed there was an error. However there seems to be some internal problem with stackblitz dependencies and that’s why it’s not compiling there.

The error you get was caused by missing registerAllModules import in app.module file. When I tested your code locally and added that import everything worked as it should.

import { registerAllModules } from 'handsontable/registry';

// register Handsontable's modules
registerAllModules();

You can read more about it here https://handsontable.com/docs/angular-modules/#step-1-import-the-handsontable-base-module and here https://handsontable.com/docs/migration-from-10.0-to-11.0/#step-1-react-angular-vue-register-your-modules

Let me know if that helps with your issue.

@adrian.szymanski thanks it worked i have another issue with culture where i am trying to set de-DE culture but its not affecting the data. i have setting as given below

  hotSettings: Handsontable.GridSettings = {
  width: '100%',
  manualRowResize: true,
  manualColumnResize: true,
  allowRemoveColumn: false,
  allowInsertRow: true,
  startRows: 5,
  rowHeaders: true,
  height: 'auto',
  language: 'de-DE',
  licenseKey: 'non-commercial-and-evaluation',
  allowRemoveRow: true,
  outsideClickDeselects: false,
  stretchH: 'all', // 'none' is default
  contextMenu: true,
  data: this.getCarData(),
  columns: [{
      data: 'price_eur',
      type: 'numeric',
      numericFormat: {
          pattern: '0,0.00 $',
          culture: 'de-DE' // use this for EUR (German),
          // more cultures available on http://numbrojs.com/languages.html
      }
  }]

};

is there anything that i am missing ?

Hi @talhach891

I created an example with your settings and it works fine: https://jsfiddle.net/bqkea21x/1/

However I cannot see how your data structure looks like, maybe there’s something in there that interfere with the settings.

1 Like

thank you @adrian.szymanski and @aleksandra_budnik wonder work of your team

1 Like