barvian / fluid-tailwind

Build better responsive designs in less code.
https://fluid.tw
MIT License
1.24k stars 19 forks source link

Error when using esm.sh #13

Closed christianmagill closed 6 months ago

christianmagill commented 6 months ago

I've recently over the past couple days started receiving an error when using Winden/Yabe Suil for Wordress

import { fluidExtractor, fluidCorePlugins, defaultThemeScreensInRems, defaultThemeFontSizeInRems } from 'https://esm.sh/fluid-tailwind?bundle-deps&external=fs';

Config Error SyntaxError: The requested module '/v135/tailwindcss@3.4.1/X-ZS9mcw/es2022/lib/corePlugins.js' does not provide an export named 'corePlugins'

It was previously working.

barvian commented 6 months ago

Hmm, it looks like a regression in the last update. Could you try https://esm.sh/fluid-tailwind@0.1.6?bundle-deps&external=fs for now? I'll look into the cause and try to push a fix in the meantime 🤔

christianmagill commented 6 months ago

Yes, reverting to the previous version fixes the issue.

krstivoja commented 6 months ago

+1

barvian commented 6 months ago

I've opened an issue with ESM.sh because I can't seem to find what changed between versions to cause this breakage 🤔

barvian commented 6 months ago

This should be fixed with v0.3.6. Here's a working StackBlitz that should be adaptable to Winden/Yabe Suil. Note the (currently undocumented) option passed to the plugin:

plugins: [
  fluid({
    checkExtractConfig: false
  })
]

This was necessary because it seems Tailwind Play ignores or overrides the extractor passed in (though it works without one).

Feel free to comment if you're still experiencing issues!

krstivoja commented 6 months ago

Awesome stuff @barvian. Updated our documentation for Winden and I can confirm that this setup is working now: https://docs.dplugins.com/winden/fluid-tailwind/