Replies: 1 comment
-
Hey @arkmech! 👋 tailwind-merge should work in the browser, Node.js, Deno, etc., so should also work as part of a library. Seems like you have an issue in your bundler or whatever is managing your module imports. tailwind-merge doesn't have anything to do with tty or picocolors, so the error probably originates elsewhere. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My
tailwind-config
library exportscn
utility.twMergeClassGroups.ts
cn.ts
ui
library, then uses thecn
fromtailwind-config
library.app
then uses the the components fromui
library.cn
This did not work, I thought twMerge couldn't be exported as a library, but you will see below, any part of twMerge that comes from a library will not work, including the objects that that you keys from.
What I tried next, I had the
cn.ts
in theui
library directly and was only importing thefontSize
andtextColor
fromtailwind-config
. This also did not work.The main goal here is to have
tailwind-config
be the single source of truth.The one thing that did work? Duplicating the twMergeClassGroups to be used directly in
ui
, but now have two sources of truth...Is there something obvious, I'm missing? In the fact twMerge can't be used with libraries? If I really want a single source of truth, that means I need to combine my
tailwind-config
andui
library in a single package for this to work?Error: Dynamic require of tty is not supported.
node_modules/picocolors/picocolors.js
node_modules/tailwindcss/lib/util/log.js
node_modules/tailwindcss/lib/public/colors.js
It looks like a tailwindcss error, but if twMerge is removed, app not longer crashes.
Beta Was this translation helpful? Give feedback.
All reactions