Closed marcello-palmitessa closed 1 year ago
do you have a tsconfig.json
? can you share it?
Sure, here it is, and I forgot to mention, the project is using React 18 and Next.js 13 with the /pages folder:
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"baseUrl": ".",
"paths": {
"@/blocks/*": [
"blocks/*"
],
"@/components/*": [
"components/*"
],
"@/lib/*": [
"lib/*"
],
"@/queries/*": [
"queries/*"
],
"@/styles/*": [
"styles/*"
],
"@/types/*": [
"types/*"
]
},
"incremental": true
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx"
],
"exclude": [
"node_modules",
"test/*",
"migrations/*"
]
}
@marcello-palmitessa can you please try to temporarly replace the content of your tsconfig with the following, and running the migrations again?
{
"compilerOptions": {
"declaration": true,
"importHelpers": true,
"module": "commonjs",
"strict": true,
"target": "es2019"
}
}
Error: POST https://site-api.datocms.com/plugins: 422 Unprocessable Entity
ok, so this is a different type of issue. when the CLI is trying to run the migration, a specific step in the migration file is failing (in particular, a plugin with the same name already exists). it could be either:
thanks @stefanoverna I think I found the issue, in the generated script a plugin was first declared and then deleted, bu thte deletion is an error, the plugin is needed:
console.log('Create private plugin "Scribble Editor"'); newPlugins['48468'] = await client.plugins.create({ name: 'Scribble Editor', url: 'https://tangity-scribble-editor.netlify.app/', description: 'Scribble Editor', package_name: null, package_version: null, permissions: [] }); await client.plugins.update(newPlugins['48468'], { parameters: { migratedFromLegacyPlugin: true } });
console.log('Delete plugin "Scribble Editor"'); await client.plugins.destroy('116252');
cool! we should have fixed this bug in the latest CLI version :)
Hi, I created a migration script using the automation via CLI, but then whern I try to apply it using:
datocms migrations:run --destination=main --api-token=xxxxxx
I get the error: Running migration "1670316600_version3.ts"... ! SyntaxError: Unexpected token 'export'The generated migration script is like this:
Running with macOS Ventura, nodejs v18.2.0
any ideas please?