Open khaleelkhalifa opened 10 months ago
@khaleelkhalifa can you please try to temporarily 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"
}
}
Hi @stefanoverna , Still the same error I am afraid
@khaleelkhalifa we don't use "prettier-plugin-tailwindcss" so it's quite strange. Can you provide a complete stack trace, if available?
@stefanoverna I am only getting that error back without any stack trace and can't see a flag to turn on verbose. Do you know what I need to pass in to get one?
Note, I am using prettier-plugin-tailwindcss as a dev dependancy for my project.
Were you able to replicate this issue? @stefanoverna
Nope @khaleelkhalifa.. can you share with us a repo with the problem? You can send it to support@datocms.com if you prefer.
Hi, Please see https://github.com/khaleelkhalifa/dato-migrations
@marcelofinamorvieira can you take a look at this?
Hi, Has there been any update on this? Keen to get migrations working on our tech stack
Hey @khaleelkhalifa sorry for the delay on the response!
It seems like all versions after v0.5 do not support ts files that are compiled to "commonjs" to include "import" as you can read right here, so it won't be compatible with our CLI:
https://github.com/tailwindlabs/prettier-plugin-tailwindcss/issues/207#issuecomment-1698071122
Since our migration files always start with
import { Client, SimpleSchemaTypes } from "@datocms/cli/lib/cma-client-node";
You get that error when trying to write the migration file if you run the generate migration command in a repository with that prettier plugin version.
An easy way to solve this would be to just generate and run the migrations in a different app folder, one without the prettier + prettier-tailwind plugin, with a clean package.json Using a repo just for the migrations is usually better (as the migrations don't need to be in the same folder as your front-end, since they only interact with Dato directly)
Hi, Currently having issues trying to run the following
npx datocms migrations:new --autogenerate=feature:main 'test'
I have the plugin
"prettier-plugin-tailwindcss": "^0.5.6",
installed with"@datocms/cli": "^1.2.1"
as devDependencies I am getting the following error