Error when autogenerating migrations

Hi !

I tried to create a new migrations file today, but I am facing an issue and can’t find what I need to check to go forward :slight_smile:

Maybe someone already faced this issue.

Running command on datocms/cli 2.0.0

datocms migrations:new 'New migration file' --autogenerate='feature-new-website' --api-token=[TOKEN]

give

* `[1] GET https://site-api.datocms.com/environments
* [1] Status: 200 (OK)
* [2] GET https://site-api.datocms.com/site?include=item_types%2Citem_types.fields%2Citem_types.fieldsets
* [3] GET https://site-api.datocms.com/menu-items
* [4] GET https://site-api.datocms.com/schema-menu-items
* [5] GET https://site-api.datocms.com/plugins
* [6] GET https://site-api.datocms.com/workflows
* [7] GET https://site-api.datocms.com/item-type-filters
* [8] GET https://site-api.datocms.com/upload-filters
* [5] Status: 200 (OK)
* [8] Status: 200 (OK)
* [6] Status: 200 (OK)
* [7] Status: 200 (OK)
* [4] Status: 200 (OK)
* [3] Status: 200 (OK)
* [2] Status: 200 (OK)
* [9] GET https://site-api.datocms.com/site?include=item_types%2Citem_types.fields%2Citem_types.fieldsets
* [10] GET https://site-api.datocms.com/menu-items
* [11] GET https://site-api.datocms.com/schema-menu-items
* [12] GET https://site-api.datocms.com/plugins
* [13] GET https://site-api.datocms.com/workflows
* [14] GET https://site-api.datocms.com/item-type-filters
* [15] GET https://site-api.datocms.com/upload-filters
* [15] Status: 200 (OK)
* [10] Status: 200 (OK)
* [13] Status: 200 (OK)
* [14] Status: 200 (OK)
* [12] Status: 200 (OK)
* [11] Status: 200 (OK)
* [9] Status: 200 (OK)
* [16] GET https://site-api.datocms.com/roles
* [16] Status: 200 (OK)
* Writing "migrations/1712668972_newMigrationFile.ts"... !
*     TypeError: Cannot read properties of null (reading 'type')`

I just make some new model and block, but no field name type on it.

I don’t know what information I can give you to help me. so feel free to ask

Hi @pARNAUD,

Welcome to the forum!

Are you running in the datocms cli in a clean new folder, or in an existing project codebase?

Would you mind sharing the project you’re trying this on with us, please (DM or email is fine) so we can try it ourselves?

Hi !

It’s an existing project under DNA so I could not share it… I will try to do a minimal reproduction on a new project.

I can share you the command output with log level to BODY if this can also help.

Hi !

I just made some content edit on DatoCMS this morning. I tried to re-run the command now and it’s worked…

Don’t know what edit have fixed the issue =:sweat_smile:

1 Like