-
Notifications
You must be signed in to change notification settings - Fork 134
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
prettier-plugin-tailwindcss causing global error handling to dump prettier flow.mjs contents to the console #321
Comments
This has to be one of the wildest things I've seen. I have no idea what would cause this 😱 I'll take a look today |
Even smaller repro: import "prettier-plugin-tailwindcss";
throw new Error("test"); |
* chore: update nx to 19.8.2 * chore: add try catch to release script to work around tailwindlabs/prettier-plugin-tailwindcss#321
Uring
That plugin doesn't do anything weird but it does import (and subsequently bundle)
The flow parser is written in OCaml so it's harder to track the source of the issue there. |
I think this is because of the OCaml byte code -> JS compiler that flow uses ( I'm not sure if we can find a way to lazy load these plugins if they're not used. Prettier does but I think uses private API to do so. I'll look into it. |
What version of
prettier-plugin-tailwindcss
are you using?Latest - v0.6.8
What version of Tailwind CSS are you using?
Latest - v3.3.3
What version of Node.js are you using?
v20.17.0
What package manager are you using?
npm
What operating system are you using?
macOS
Reproduction URL
https://github.com/JamesHenry/prettier-tailwindcss-flow-repro
Describe your issue
Full explanation:
https://www.loom.com/share/8aa70b8bd4d54299a018d1f35f64fc6a
Steps per README
ESM vs CJS doesn't matter, both exhibit the same behavior.
The presence of
prettier-plugin-tailwindcss
is key, through its dependency on the flow parser, it is somehow causing all subsequent errors to be processed byprettier/plugins/flow.mjs
, which then dumps contents from that minified file to the console.The text was updated successfully, but these errors were encountered: