Skip to content

ResolveConfig Issue #1129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cizza opened this issue Sep 18, 2019 · 8 comments
Closed

ResolveConfig Issue #1129

cizza opened this issue Sep 18, 2019 · 8 comments

Comments

@cizza
Copy link

cizza commented Sep 18, 2019

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.

@adamwathan
Copy link
Member

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 👍🏻

@adamwathan
Copy link
Member

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 }
});

@cizza
Copy link
Author

cizza commented Sep 18, 2019

Thank you!

@cizza
Copy link
Author

cizza commented Sep 18, 2019

In my case I had to provide

.webpackConfig({
node: { fs: 'empty' }
});

@m11m
Copy link

m11m commented Sep 24, 2019

I worked around the issue with externals:

externals: { fs: "commonjs fs" }

@bipsBro
Copy link

bipsBro commented Sep 25, 2019

I worked around the issue with externals:

externals: { fs: "commonjs fs" }

in which file @m11m ?

@adamwathan
Copy link
Member

@bipsBro in your webpack config 👍

https://webpack.js.org/configuration/externals/

@mehrancodes
Copy link

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.

2Pacalypse- added a commit to ShieldBattery/ShieldBattery that referenced this issue Dec 23, 2019
browsers

I honestly have no idea which library is even doing this, but since
it started to be an issue from the last commit where
`react-transition-group` was added, I will assume it is that one. Or one
of *its* dependencies.

In any case, it's really annoying and this "fix" doesn't seem optimal to
me; I'm not even sure if it didn't break anything else (from my limited
testing, it didn't). See this github issue for a bit more info:
tailwindlabs/tailwindcss#1129
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants