Description
babel-plugin-tester
version: 11.0.4
Relevant code or config, What you did:
module.exports = {
printWidth: 100,
singleQuote: true,
trailingComma: 'all',
plugins: ['prettier-plugin-tailwindcss'],
}
What happened:
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/oliviertassinari/material-ui/node_modules/.pnpm/[email protected][email protected]/node_modules/prettier-plugin-tailwindcss/dist/index.mjs not supported.
Instead change the require of /Users/oliviertassinari/material-ui/node_modules/.pnpm/[email protected][email protected]/node_modules/prettier-plugin-tailwindcss/dist/index.mjs to a dynamic import() which is available in all CommonJS modules.
Problem description: prettier-plugin-tailwindcss
is an ESM only package, proof: https://unpkg.com/prettier-plugin-tailwindcss/package.json, but babel-plugin-tester@latest
depends on:
babel-plugin-tester/package.json
Line 70 in e8c7f88
The problem is that support for ESM plugin comes only later on https://prettier.io/blog/2023/07/05/3.0.0.html#support-plugins-in-esm-13201httpsgithubcomprettierprettierpull13201-by-fiskerhttpsgithubcomfisker.
Suggested solution: Can we publish a new version?
https://github.com/babel-utils/babel-plugin-tester/releases/tag/v12.0.0-canary.1 solved the problem, but it's unstable.