Skip to content
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

package causes postcss compile error (using create-react-app 5.0.0) #2265

Closed
davegravy opened this issue Mar 16, 2022 · 5 comments
Closed

package causes postcss compile error (using create-react-app 5.0.0) #2265

davegravy opened this issue Mar 16, 2022 · 5 comments
Labels
state/awaiting-investigation Anything which needs more investigation type/upstream Any issues in dependencies

Comments

@davegravy
Copy link

davegravy commented Mar 16, 2022

Bug Report

Upgrading to CRA v5 I'm unable to compile. Uninstalling packages systematically I narrowed the culprit down to fomantic-ui. I produced a minimal example below.

Steps to reproduce

  1. npx create-react-app@latest cra-test --use-npm

Follow documented install instructions:
2. npm install --ignore-scripts fomantic-ui
3. cd node_modules/fomantic-ui
4. npx gulp install (select defaults)
5. npx gulp build
7. npm start (this works normally)
8. rm node_modules package-lock.json -Rf
9. npm install
10. npm start

Expected result

For compile to succeed

Actual result

The compile error I receive:

ERROR in ./src/index.css (./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[5].use[2]!./node_modules/source-map-loader/dist/cjs.js!./src/index.css)
Module Error (from ./node_modules/postcss-loader/dist/cjs.js):
Loading PostCSS "postcss-flexbugs-fixes" plugin failed: Cannot find module 'postcss-flexbugs-fixes'
Require stack:

  • /home/davidg/cra-test/node_modules/postcss-loader/dist/utils.js
  • /home/davidg/cra-test/node_modules/postcss-loader/dist/index.js
  • /home/davidg/cra-test/node_modules/postcss-loader/dist/cjs.js
  • /home/davidg/cra-test/node_modules/loader-runner/lib/loadLoader.js
  • /home/davidg/cra-test/node_modules/loader-runner/lib/LoaderRunner.js
  • /home/davidg/cra-test/node_modules/webpack/lib/NormalModule.js
  • /home/davidg/cra-test/node_modules/webpack-manifest-plugin/dist/index.js
  • /home/davidg/cra-test/node_modules/react-scripts/config/webpack.config.js
  • /home/davidg/cra-test/node_modules/react-scripts/scripts/start.js

Testcase

Screenshot (if possible)

image

Versions

fomantic-ui@2.8.8 (also confirmed with fomantic-ui@2.9.0-beta.259)
create-react-app@5.0.0
node@16.8.0
npm@8.5.4

@davegravy davegravy added state/awaiting-investigation Anything which needs more investigation state/awaiting-triage Any issues or pull requests which haven't yet been triaged type/bug Any issue which is a bug or PR which fixes a bug labels Mar 16, 2022
@davegravy davegravy changed the title package causes compile error using create-react-app 5.0.0 package causes postcss compile error using (create-react-app 5.0.0) Mar 16, 2022
@davegravy
Copy link
Author

davegravy commented Mar 16, 2022

In order to eliminate the error it's insufficient to merely npm uninstall fomantic-ui. It's necessary to follow that with rm node_modules package-lock.json -Rf && npm install.

BTW I'm not positive this is an FUI bug (versus CRA5) but would appreciate help identifying that either way.

@davegravy davegravy changed the title package causes postcss compile error using (create-react-app 5.0.0) package causes postcss compile error (using create-react-app 5.0.0) Mar 16, 2022
@lubber-de lubber-de added state/awaiting-investigation Anything which needs more investigation type/upstream Any issues in dependencies and removed state/awaiting-triage Any issues or pull requests which haven't yet been triaged state/awaiting-investigation Anything which needs more investigation type/bug Any issue which is a bug or PR which fixes a bug labels Mar 16, 2022
@lubber-de
Copy link
Member

lubber-de commented Mar 16, 2022

FUI itself does not use postcss loader nor postcss-flexbug, so i would not declare this as a FUI bug per se as it comes from CRA5.

I believe postcss loader finds something in the FUI code which triggers it to expect flexbug plugin (which is not loaded/available as seen in your screenshot) .

If you can find out if/which css code of FUI is triggering this, we might investigate, but at the moment i don't see any point where to dig into the FUI code to fix something.

@lubber-de
Copy link
Member

You could try to manually install postcss-flexbug via

npm install postcss-flexbugs-fixes

inside your project or globally via

npm install -g postcss-flexbugs-fixes

if that solves your issue (because plugin should now be found) or at least gives more details which part of FUI might cause it.

@davegravy
Copy link
Author

npm install postcss-flexbugs-fixes

Thanks.

Installing this package, there are two others which it then complains can't be found:

  • postcss-normalize
  • postcss-preset-env

If I install those in addition then the error disappears. I'm also not sure how to identify what aspect of fomantic-ui is triggering this. I can create an issue on the CRA github and maybe they will have insight.

Thanks for FUI, I really like it!

@lubber-de
Copy link
Member

Closing for now as CRA 5 obviously has to adjust their dependency chain.
Happy to reopen in case we really have to fix something in FUI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state/awaiting-investigation Anything which needs more investigation type/upstream Any issues in dependencies
Projects
None yet
Development

No branches or pull requests

2 participants