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

Tailwind Standalone CLI fails building with --postcss option #8766

Closed
seyeong opened this issue Jul 3, 2022 · 1 comment · Fixed by #8769
Closed

Tailwind Standalone CLI fails building with --postcss option #8766

seyeong opened this issue Jul 3, 2022 · 1 comment · Fixed by #8769
Assignees

Comments

@seyeong
Copy link

seyeong commented Jul 3, 2022

What version of Tailwind CSS are you using?

For example: v14.3.0

What build tool (or framework if it abstracts the build tool) are you using?

For example: N/A

What version of Node.js are you using?

v14.3.0

What browser are you using?

For example: N/A

What operating system are you using?

For example: ubuntu

Reproduction URL
N/A

Describe your issue

build command fails with Loading PostCSS Plugin failed: Cannot find module 'tailwindcss' error.

~ mkdir test~ cd testtest wget https://github.com/tailwindlabs/tailwindcss/releases/download/v3.1.4/tailwindcss-linux-x64
➜  test chmod 755 tailwindcss-linux-x64 
➜  test ./tailwindcss-linux-x64 init --full --postcss

Created Tailwind CSS config file: tailwind.config.js
Created PostCSS config file: postcss.config.js

➜  test ./tailwindcss-linux-x64 build --postcss  

warn - The `content` option in your Tailwind CSS configuration is missing or empty.
warn - Configure your content sources or your generated CSS will be missing styles.
warn - https://tailwindcss.com/docs/content-configuration
/snapshot/tailwindcss/node_modules/postcss-load-config/src/plugins.js:28
    throw new Error(`Loading PostCSS Plugin failed: ${err.message}\n\n(@${file})`)
          ^

Error: Loading PostCSS Plugin failed: Cannot find module 'tailwindcss'
Require stack:
- /home/ubuntu/test/postcss.config.js
1) If you want to compile the package/file into executable, please pay attention to compilation warnings and specify a literal in 'require' call. 2) If you don't want to compile the package/file into executable and want to 'require' it from filesystem (likely plugin), specify an absolute path in 'require' call using process.cwd() or process.execPath.

(@/home/ubuntu/test/postcss.config.js)
    at load (/snapshot/tailwindcss/node_modules/postcss-load-config/src/plugins.js:28:11)
    at /snapshot/tailwindcss/node_modules/postcss-load-config/src/plugins.js:53:16
    at Array.map (<anonymous>)
    at plugins (/snapshot/tailwindcss/node_modules/postcss-load-config/src/plugins.js:52:8)
    at processResult (/snapshot/tailwindcss/node_modules/postcss-load-config/src/index.js:37:14)
    at /snapshot/tailwindcss/node_modules/postcss-load-config/src/index.js:151:14
    at async loadPostCssPlugins (/snapshot/tailwindcss/lib/cli.js:412:16)
    at async buildOnce (/snapshot/tailwindcss/lib/cli.js:543:78)
@thecrypticace thecrypticace self-assigned this Jul 4, 2022
@thecrypticace thecrypticace changed the title Tailwind CLI fails with --postcss option Tailwind Standalone CLI fails building with --postcss option Jul 4, 2022
@thecrypticace
Copy link
Contributor

Hey, thanks for reporting this one! I've fixed the issue and the fix will go out when we release v3.1.5 this week. As a workaround until it's released you can remove tailwindcss and autoprefixer from the postcss config and they'll be injected automatically in the current standalone CLI. You just won't have control over their placement.

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

Successfully merging a pull request may close this issue.

2 participants