Describe your question/issue in detail
I’m following the video from the documentation and I can’t make a migration — even something simple fails.
Impacted feature
migration
What steps have you taken to resolve this issue already?
I tried to remove all the extra data from the custom type page, so the only stuff that is in there is the title. I removed all the meta tags from SEO.
Errors
response: 'An Unexpected error happened on our side, please contact our support'
Your Role
Developer
Hosting provider
N/A (local dev environment)
Package.json file
{
"dependencies": {
"@prismicio/client": "^7.0.0",
"dotenv": "^16.0.0"
}
}
Steps to reproduce
import "dotenv/config";
import * as prismic from "@prismicio/client";
async function migrateDocument() {
const writeClient = prismic.createWriteClient("my-repo", {
writeToken: process.env.PRISMIC_TOKEN,
});
const migration = prismic.createMigration();
migration.createDocumentFromPrismic(
{
uid: "documentuid-2",
type: "page",
lang: "en-gb",
alternate_languages: ["en-gb"],
data: {
title: [
{
type: "heading1",
text: "My Page Title",
spans: [],
},
],
slices: [],
},
},
"Foo"
);
console.log(JSON.stringify(migration, null, 2));
await writeClient.migrate(migration, {
reporter: (event) => {
console.log(event);
},
});
}
await migrateDocument();
Then I run:
npx tsx migrate.mts
And I get:
response: 'An Unexpected error happened on our side, please contact our support'
The document fail in the phase of "updating" so the document appear in the migration section of primic but empty.
Thanks in advance