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

chore(examples): add postcss as tailwindcss dependency (#1497) #1500

Merged
merged 3 commits into from Feb 18, 2022

Conversation

navid-kalaei
Copy link
Contributor

Problem

tailwind cannot run without postcss for the tailwindcss example

Error log

$ yarn build:css
yarn run v1.22.17
$ tailwindcss -o ./app/tailwind.css
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'postcss'
Require stack:
- ~/remix/examples/tailwindcss/node_modules/tailwindcss/lib/lib/generateRules.js
- ~/remix/examples/tailwindcss/node_modules/tailwindcss/lib/lib/expandTailwindAtRules.js
- ~/remix/examples/tailwindcss/node_modules/tailwindcss/lib/processTailwindFeatures.js
- ~/remix/examples/tailwindcss/node_modules/tailwindcss/lib/cli.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (~/remix/examples/tailwindcss/node_modules/tailwindcss/lib/lib/generateRules.js:6:39)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '~/remix/examples/tailwindcss/node_modules/tailwindcss/lib/lib/generateRules.js',
    '~/remix/examples/tailwindcss/node_modules/tailwindcss/lib/lib/expandTailwindAtRules.js',
    '~/remix/examples/tailwindcss/node_modules/tailwindcss/lib/processTailwindFeatures.js',
    '~/remix/examples/tailwindcss/node_modules/tailwindcss/lib/cli.js'
  ]
}
error Command failed with exit code 1.

Success log

$ yarn build:css
yarn run v1.22.17
$ tailwindcss -o ./app/tailwind.css

Done in 278ms.
Done in 0.99s.

Related issue

#1497

@remix-cla-bot
Copy link
Contributor

remix-cla-bot bot commented Jan 14, 2022

Hi @navid-kalaei,

Welcome, and thank you for contributing to Remix!

Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once.

You may review the CLA and sign it by adding your name to contributors.yml.

Once the CLA is signed, the CLA Signed label will be added to the pull request.

If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at hello@remix.run.

Thanks!

- The Remix team

@remix-cla-bot
Copy link
Contributor

remix-cla-bot bot commented Jan 14, 2022

Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳

@mcansh
Copy link
Collaborator

mcansh commented Jan 14, 2022

are you using yarn to manage your dependencies? tailwind has postcss as a peer dependency and yarn doesn't automatically install those like npm does tailwindlabs/tailwindcss#6916 (comment)

so it might be worth noting this in the example's README and on the styling guide

@navid-kalaei
Copy link
Contributor Author

yes, I use yarn. however, thinking of Remix as a standard project, I expect that to be easy to install with major package managers including yarn.

@MichaelDeBoey
Copy link
Member

If you're using the Tailwind CLI (which we are in this example), you don't need to install postcss

@jacob-ebey
Copy link
Member

If you're using the Tailwind CLI (which we are in this example), you don't need to install postcss

If you are using yarn you do because the tailwind cli improperly marks PostCSS as a peer dependency. See Logan's comment / link above.

Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@kentcdodds kentcdodds merged commit 2a2c9dc into remix-run:main Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants