netlify-cms raises error after being hot-reloaded

Created on 8 Jan 2021  路  1Comment  路  Source: netlify/netlify-cms

Describe the bug
When cms is being hot-reloaded, config validation results in the following error:

Unhandled Runtime Error
Error: 'collections[0].view_filters' should NOT have fewer than 1 items
'collections[0].view_groups' should NOT have fewer than 1 items

To Reproduce

  1. Go to https://codesandbox.io/s/peaceful-moon-3st9j
  2. Click on 'Admin' link
  3. Click login button (there will be login error, but that's fine)
  4. Go to admin.js file and make any change to it (for example add console.log statement)
  5. Save file
  6. Observe the error

Expected behavior
There shouldn't be any error after hot reload

Additional context
That probably happens because after hot reload we validate existing config (which is normalized and to which defaults are applied), where each collection has view_filters and view_groups equal to empty array. I think this PR https://github.com/netlify/netlify-cms/pull/4807 should fix it.

bug

>All comments

Thanks @smashercosmo, I'm planning on reviewing your PRs soon (either today or early next week).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chriskirknielsen picture chriskirknielsen  路  3Comments

andresalerno picture andresalerno  路  3Comments

emckay picture emckay  路  3Comments

BerkeleyTrue picture BerkeleyTrue  路  3Comments

marcojakob picture marcojakob  路  3Comments