Remix Tailwind Vercel Edge problems #8204
Replies: 4 comments 4 replies
-
OK managed to get it working, I'm using esm, and I don't understand exactly what the issue is, but if I copy the tailwind-merge src folder to my utils and use this instead of the npm package then it all works fine, so I'm up and running, but would be really nice to understand why this is required, maybe an issue with tailwind-merge and esm? |
Beta Was this translation helpful? Give feedback.
-
I ran into this issue as well- I ran into an identical issue with the "bcryptjs" package, and had to copy that as well. It seems there are some fairly frustrating foot-guns somewhere in the locus of ESM, Remix, the edge runtime, and the way that certain dependencies are configured, but I haven't been able to figure out exactly what is going on. Both this package and "bcryptjs" are very widely used, it seems to me that more and more folks will run into this as more adopt native ESM and edge environments. |
Beta Was this translation helpful? Give feedback.
-
Oh! While the following solution didn't work for "bcrypt.js", it appears to work fine for this package: if you add |
Beta Was this translation helpful? Give feedback.
-
@dananjaya6005 Here is the code that worked for me. Inspired by #8204 (comment) and #7865 (comment). Hope this helps!
|
Beta Was this translation helpful? Give feedback.
-
Hi there,
I am trying to deploy a remix app to the vercel edge, I use tailwind extensively in the app and this uses tw-merge (Tailwind Merge).
But this falls over on vercel edge. I get...
Error: The Edge Function "404" is referencing unsupported modules:
10:44:01.535 | - build/build-edge-eyJydW50aW1lIjoiZWRnZSJ9.js: tailwind-merge
Is there any known workaround to use tw-merge on vercel edge. I find it almost incomprehensible that no-one else has hit this?
Beta Was this translation helpful? Give feedback.
All reactions