ResolveConfig Issue
Hi,
I've upgraded to a 1.12 tailwindcss version and I've encountered an issue with the resolveConfing.js function.
I'm using basically the same syntax as displayed on the website:
`import resolveConfig from 'tailwindcss/resolveConfig'; import tailwindConfig from '../../../tailwind.config.js';
export default resolveConfig(tailwindConfig)`
However when I compile the stylesheets, I get an error:
ERROR in ./node_modules/reduce-css-calc/dist/parser.js Module not found: Error: Can't resolve 'fs' in 'C:\xampp\htdocs\widow_source\node_modules\reduce-css-calc\dist'
I'm using laraveMix processing tailwind thusly:
`const mix = require('laravel-mix'); require('mix-tailwindcss'); require('laravel-mix-alias');
mix.js('resources/js/scripts.js', 'public/js') .sass('resources/sass/styles.scss', 'public/css') .tailwind() .version();`
Npm install of the missing 'fs' dependency doesn't solve the issue.
Any help would be welcome,
Thank you.
This is an annoying problem and I hope this PR gets merged to fix the core of it, but in the mean time you need to stub the fs module in your webpack config:
https://webpack.js.org/configuration/node/#other-node-core-libraries
Setting fs to false or 'empty' will both work 👍🏻
For Laravel Mix specifically, you'll want to update your config to this:
const mix = require('laravel-mix');
require('mix-tailwindcss');
require('laravel-mix-alias');
mix.js('resources/js/scripts.js', 'public/js')
.sass('resources/sass/styles.scss', 'public/css')
.tailwind()
.version()
.webpackConfig({
node: { fs: false }
});
Thank you!
In my case I had to provide
.webpackConfig({ node: { fs: 'empty' } });
I worked around the issue with externals:
externals: {
fs: "commonjs fs"
}
I worked around the issue with externals:
externals: { fs: "commonjs fs" }
in which file @m11m ?
@bipsBro in your webpack config 👍
https://webpack.js.org/configuration/externals/
Tried to add tailwind custom-forms to my config and got this error. On the latest version of Laravel+Tailwindcss
Not sure why none of the above solutions work in my case.