gqty-dev/gqty

ESM-only prettier plugins break @gqty/cli

Closed this issue · 2 comments

If you use a ESM-only prettier plugin, such us prettier-plugin-tailwindcss, the codegen.mjs will throw the following error:

Error [ERR_REQUIRE_ESM]: require() of ES Module .../prettier.config.js from .../node_modules/@gqty/cli/deps.js not supported.

Based on this issue, this plugin can not be loaded with require or import, just put it in the prettier.config.js file like this:

const config = {
  semi: false,
  singleQuote: true,
  plugins: ['prettier-plugin-tailwindcss']
}
export default config

Currently using:
"@gqty/cli": "4.0.0-alpha-7b21563c.0",

We have a thread in Discord about a similar issue, which the op found a workaround.
Would you mind heading there to see if it's the same case?

https://discord.com/channels/874477141834739762/1200868810434039939

Please feel free to reopen if the issue persists.