-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to autogenerate migrations when using plugin prettier-plugin-tailwindcss #19
Comments
@khaleelkhalifa can you please try to temporarily replace the content of your tsconfig with the following, and running the migrations again?
|
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. 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 [email protected] if you prefer. |
@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: tailwindlabs/prettier-plugin-tailwindcss#207 (comment) 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 |
I started experiencing this issue after upgrading |
Mh, v2.0.15 solves a super-minor issue (migration generation crashed if field ID or label contained the word "export") so I don't think it could be the cause of the problem. Can you share a repo reproducing the issue @luukschipperheyn so we can better investigate? |
@stefanoverna here you go. I copied the dependencies and some config files from the project I'm working on: https://github.com/luukschipperheyn/datocms-cli-migration-issue steps to reproduce
This yields the following error for me:
Downgrading @datocms/cli to 2.0.14 gets rid of the error:
|
Thanks for the repro @luukschipperheyn! v2.0.16 should fix this issue. — Basically, what happens is that the CLI formats the migration file with Prettier and tries to reuse the .prettierrc settings from the repository in which it is run (which makes sense). But things can go wrong. In your case, the Tailwind plugin only supports Prettier 3, while the CLI uses Prettier 2. The fix has been to continue trying to use the .prettierrc.. but if it fails, fallback to pristine Prettier settings. |
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 devDependenciesI am getting the following error
The text was updated successfully, but these errors were encountered: