Skip to content
This repository was archived by the owner on Apr 6, 2021. It is now read-only.

PostCSS stuck after generating output #139

Closed
ConsoleTVs opened this issue Mar 22, 2021 · 2 comments
Closed

PostCSS stuck after generating output #139

ConsoleTVs opened this issue Mar 22, 2021 · 2 comments

Comments

@ConsoleTVs
Copy link

ConsoleTVs commented Mar 22, 2021

What version of @tailwindcss/jit are you using?

0.1.6

What version of Node.js are you using?

v15.3.0

What browser are you using?

N/A

What operating system are you using?

macOS

Reproduction repository

N/A

The postcss cli never stops. I have to manually control + c to stop it. The file is correctly generated tho after a few ms.

If I use the cross-env and pass in the production flag, it does correctly stop.

postcss.config.js:

module.exports = {
  plugins: {
    '@tailwindcss/jit': {},
    'autoprefixer': {},
  },
}

script to execute it:

{
  "tw": "postcss ./resources/css/widget.css -o ./public/widget.css"
}
> XXXX@1.0.0 tw
> postcss ./resources/css/widget.css -o ./public/widget.css

(it never stops, file is correctly generated tho)
@ConsoleTVs ConsoleTVs changed the title PostCSS comilation works but does not finish the process PostCSS stuck after generating output Mar 22, 2021
@adamwathan
Copy link
Member

Hey! Make sure you set the TAILWIND_MODE=build env variable if you are doing a development build without a watcher.

From the README:

Make sure you set NODE_ENV=development if you are running a watcher, or Tailwind won't watch your template files for changes. Set NODE_ENV=production for one-off builds.

If you want to control whether Tailwind watches files or not more explicitly, set TAILWIND_MODE=watch or TAILWIND_MODE=build to override the default NODE_ENV-based behavior.

For example if you want to do one-off builds with NODE_ENV=development, explicitly set TAILWIND_MODE=build so that Tailwind knows you are just doing a one-off build and doesn't hang.

@ConsoleTVs
Copy link
Author

Thank you for the answer. I had been working too much hours and didn’t spot that, sorry for the inconvenience.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants