strapi / migration-scripts

Collection of Strapi Migration scripts
58 stars 57 forks source link

Cannot read property layouts of null #86

Closed tvvignesh closed 1 year ago

tvvignesh commented 1 year ago

Hi. We are trying to migrate from strapi v3.x to v4.x using the migration scripts and codemods.

And when we attempted it, we get the error as shown in the screenshot:

image

UnhandledPromiseRejectionWarning: TypeError: Cannot read property ‘layouts’ of null
at /opt/ramco-cements-website-v4/migration-scripts/v3-sql-v4-sql/migrate/migrateCoreStore.js:51:17
at Array.map ()
at migrateItems (/opt/ramco-cements-website-v4/migration-scripts/v3-sql-v4-sql/migrate/helpers/migrateFields.js:24:16)
at Object.migrateTables (/opt/ramco-cements-website-v4/migration-scripts/v3-sql-v4-sql/migrate/migrateCoreStore.js:45:27)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async migrate (/opt/ramco-cements-website-v4/migration-scripts/v3-sql-v4-sql/migrate/index.js:63:5)
at async f (/opt/ramco-cements-website-v4/migration-scripts/v3-sql-v4-sql/index.js:6:3)
(Use node --trace-warnings ... to show where the warning was created)
(node:3437836) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see [Command-line API | Node.js v19.4.0 Documentation](https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode)). (rejection id: 1)
(node:3437836) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

We are unable to proceed with the migration because of this. Kindly help. We reached out to support, filed a ticket in the forum here: https://forum.strapi.io/t/data-migration-issue-from-v3-sql-to-v4-sql/24873 but weren't able to get a reply on the same.

derrickmehaffy commented 1 year ago

@tvvignesh would it be possible to share your core_store table dump in v3 so we can take a look?

tvvignesh commented 1 year ago

Hi. Its almost 6 months since I had raised this issue, I managed to fix it and deliver but don't remember what I exactly did. Sorry.