bdebon / choiceof.dev

Developers have to cope with pretty hard choices every day. This is a collection of the most complex and funny choices. What will be yours?
https://choiceof.dev
GNU General Public License v3.0
473 stars 93 forks source link

Storybook Tailwind JIT/Hot Reload not working #1

Open bdebon opened 2 years ago

bdebon commented 2 years ago

I tried for hours to make the hot reload working with storybook and tailwind but even though I found apparently the solution, I can't make it work... I tried for two frustrating hours to make it fit but impossible. I always end up with a compilation error:

ModuleBuildError: Module build failed (from ./node_modules/postcss-loader/dist/cjs.js):
TypeError: Cannot read properties of undefined (reading 'config')

If I add a tailwind.config.js file at the root of the project, this error disappear but the fix still does not work.

So for now, until nx and storybook grow older together, or before a nice soul finds the solution for me, I'm gonna go the old way and I'll refresh the storybook pages each time JIT adds a new class to the project.