teambit / react-tailwind-env

An example of a custom react env with basic support for tailwindcss
9 stars 7 forks source link

postcss-loader looking at repository's postcss runcontrol configuration files #11

Open conrado opened 3 years ago

conrado commented 3 years ago

I've added a parcel bundled site directly to a branch from this repository to show the issue with postcss-loader grabbing the postcss configuration from a file in the working tree

https://github.com/conrado/react-tailwind-env/tree/postcss-loader-grabbing-local-postcss-config

When this happens the bit dev server will throw an error as it tries to look for plugins inside the bit's bvm version node_modules directory.

2021-10-01_09-50-52

the error reads:

Loading PostCSS "tailwindcss" plugin failed: Cannot find module 'tailwindcss'
Require stack:
- /Users/conrado/.bvm/versions/0.0.513/bit-0.0.513/node_modules/@teambit/react/node_modules/postcss-loader/dist/utils.js
- /Users/conrado/.bvm/versions/0.0.513/bit-0.0.513/node_modules/@teambit/react/node_modules/postcss-loader/dist/index.js
- /Users/conrado/.bvm/versions/0.0.513/bit-0.0.513/node_modules/@teambit/react/node_modules/postcss-loader/dist/cjs.js
- /Users/conrado/.bvm/versions/0.0.513/bit-0.0.513/node_modules/loader-runner/lib/loadLoader.js
- /Users/conrado/.bvm/versions/0.0.513/bit-0.0.513/node_modules/loader-runner/lib/LoaderRunner.js
- /Users/conrado/.bvm/versions/0.0.513/bit-0.0.513/node_modules/webpack/lib/NormalModuleFactory.js
- /Users/conrado/.bvm/versions/0.0.513/bit-0.0.513/node_modules/webpack/lib/Compiler.js
- /Users/conrado/.bvm/versions/0.0.513/bit-0.0.513/node_modules/webpack/lib/webpack.js
- /Users/conrado/.bvm/versions/0.0.513/bit-0.0.513/node_modules/webpack/lib/index.js
- /Users/conrado/.bvm/versions/0.0.513/bit-0.0.513/node_modules/@teambit/react/dist/webpack/webpack.config.base.js
- /Users/conrado/.bvm/versions/0.0.513/bit-0.0.513/node_modules/@teambit/react/dist/react.env.js
- /Users/conrado/.bvm/versions/0.0.513/bit-0.0.513/node_modules/@teambit/react/dist/react.main.runtime.js
- /Users/conrado/.bvm/versions/0.0.513/bit-0.0.513/node_modules/@teambit/bit/dist/load-bit.js
- /Users/conrado/.bvm/versions/0.0.513/bit-0.0.513/node_modules/@teambit/bit/dist/app.js
- /Users/conrado/.bvm/versions/0.0.513/bit-0.0.513/node_modules/@teambit/bit/bin/bit

The quickest workaround I found last night was to install the following node packages in bvm's bit version node_modules directory:

css-unit-converter
dlv
modern-normalize
postcss-js
postcss-nested
purgecss
reduce-css-calc
tailwindcss