mmintel / datocms-tools

Provides tools to import, export or reset DatoCMS projects. Will also make sure to update existing models.
10 stars 5 forks source link

"TypeError: Cannot read property 'map' of undefined" when importing models #25

Open Jorenm opened 3 years ago

Jorenm commented 3 years ago

in \@mmintel\datocms-tools\dist\lib.min.js:224:47

I stripped down the exported data to try to get it working, but it still fails with this minimal data:


  "itemTypes": [
    {
      "id": "368729",
      "name": "Hero Slider",
      "apiKey": "hero_slider",
      "collectionAppeareance": "table",
      "collectionAppearance": "table",
      "singleton": false,
      "allLocalesRequired": true,
      "sortable": false,
      "modularBlock": false,
      "draftModeActive": false,
      "tree": false,
      "orderingDirection": null,
      "hasSingletonItem": false,
      "singletonItem": null,
      "titleField": "1652474",
      "orderingField": null
    }
  ],
  "fields": [
    {
      "id": "1652474",
      "label": "Title",
      "fieldType": "string",
      "localized": false,
      "defaultValue": null,
      "apiKey": "title",
      "hint": null,
      "validators": {},
      "appeareance": {
        "addons": [],
        "editor": "single_line",
        "parameters": {
          "heading": false
        }
      },
      "appearance": {
        "addons": [],
        "editor": "single_line",
        "parameters": {
          "heading": false
        }
      },
      "position": 1,
      "itemType": "368729",
      "fieldset": null
    }
  ]
}