Next.js 10 webpack5 + Storybook 6.2.9 + Tailwind / Not loading CSS
See original GitHub issueHi, I’ve installed storybook on Next.js 10 with webpack5 + Storybook 6.2.9 + Tailwind, but I can’t see the CSS styles, as you can see in this image:
main.js
module.exports = {
stories: [
'../components/**/*.stories.mdx',
'../components/**/*.stories.@(js|jsx|ts|tsx)',
'../components/stories/*.stories.@(js|jsx|ts|tsx)',
],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/preset-create-react-app',
{
name: '@storybook/addon-postcss',
options: {
postcssLoaderOptions: {
implementation: require('postcss'),
},
},
},
],
webpackFinal: (config) => {
config.module.rules.push({
test: /\.scss$/,
sideEffects: true,
use: ['react-style-loader', 'css-loader', 'sass-loader'],
})
return config
},
}
I check all github related issues, but I don’t want to downgrade Tailwind to use Storybook, is there anything I can do?
Thanks in advance!
Issue Analytics
- State:
- Created 2 years ago
- Reactions:11
- Comments:11 (1 by maintainers)
Top Results From Across the Web
How to use SCSS and Tailwind CSS with Storybook in ...
Look into the .storybook folder, styles folder and postcss.config.js file specifically. What is in this repo works with Storybook, but not ...
Read more >How to set up Storybook with Next.js and Tailwind CSS
This step-by-step tutorial is written with Storybook v6.4.9 & TypeScript, if you found the tutorial is not working after some minor update, ...
Read more >Storybook With Tailwind And Emotion Setup - ADocLib
Unable to run Storybook after installing TailwindCSS [Stack: NextJS11 PrismicCMS with ... Next.js 10 webpack5 + Storybook 6.2.9 + Tailwind / Not loading...
Read more >storybook digital envelope routines::unsupported
createHash (node:crypto:133:10) at module.exports (/home/embold/code/handshaked/node_modules/webpack/lib/util/createHash.js:135:53) at NormalModule.
Read more >Storybook for Webpack 5 - JS.ORG
So upgrading to Webpack 5 not only helps push the web forward, but also has immediate benefits to Storybook users: Ecosystem compatibility ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No luck. I got rid of storybook and moved to Ladle (by Uber team). Ladle is built on Vite and it works out of the box with TailwindCSS and it’s blazing fast!
Note that storybook-postcss plugin has pretty much been abandoned (last commit 2021 Jan) and the storybook team has other priorities. So the chances of all the issues in this repo getting fixed is pretty low. So use best judgment.
After following the addon-postcss I’m seeing this error too. SB fails to build with CRA TW and SB with this error:
Deps:
Full repro: https://github.com/sshquack/react-ts-tw-sb-01
Any idea on how to get past this issue?