You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When launching docker with the command npm run dev (which is :set to "postcss ./src/app.pcss -o ./public/global.css --watch") nothing happens.
If launching with npm run buildor launching both of those commands outside of the docker, then everything works fine cd
Expected behavior
The file src/app.pcss should be bundled into public/global.css and any change to src/app.pcss should automatically re bundle the app.
Unfortunately, I do not know enough about docker to really help you debug this. --watch never exits until it's manually killed; is the dev command exiting in docker?
Unfortunately, I do not know enough about docker to really help you debug this. --watch never exits until it's manually killed; is the dev command exiting in docker?
Not it's not exiting. It stays open, but never writes the bundle in the output file.
It is as if it's not doing anything, however the same command without --watch works perfectly.
I just created a repo with the minimal reproducible code, but it's usually in the middle of a stack with Svelte and other watch, but only postcss --watch fails without saying anything.
thought it my be some permissions problem in docker, but even a 777 on the whole project directory does not solve anything.
I guess I could use some other package to watch all .pcss files and recompile on change, but I have always been a postcss lover so if I could make the --watch works, that would be better.
I'm going to see if I can dive in the code and maybe get some console to find where it doesn't get things
I'm seeing this as well. In my case, the postcss ... -w --verbose command immediately exits with status code 0 (and no output) if used as within scripts in the package.json file. Removing -w causes it to compile and print an output.
Oddly I'm able to get the file watching to work though if I do:
docker-compose exec frontend yarn run dev:tailwind
It just isn't working if it's part of the Yarn script that runs when I do docker-compose up frontend.
The task npm run watch (which is set to "watch": "postcss site/stylesheets/main.css -o assets/style.css --watch") seems to run, but nothing happens.
But, just like the OP, the task npm run build, or running either of these commands in the macOS Terminal works just fine.
Panic's developers have suggested to me that:
"…we're most likely looking at an issue where the PostCSS CLI is not liking something about Nova's environment for running tasks, and what exactly that is would be more easily diagnosed by PostCSS's developers."
I don't have the skills to comment on this diagnosis!
But I'd be grateful for any updates, or suggestions to help resolve this weird issue.
Sorry. I think docker, in some versions, does not implement the "emitting of events when files are modified" that watch uses, which blocks postcss from working there.
that's, if I recall correctly, the conclusion I got from looking around everywhere.
I might be wrong since it was now a few months ago and I just decided to stop using docker for watches
I noticed the same issue as @danoc and dug a bit further.
By default, docker doesn't open a tty when running a container.
I think this line is causing the immediate exit when docker is started in non-interactive mode. (no stdin/stdout gets allocated)
Hi Ryan:
Thanks for your quick reply.
I should have mentioned that I’m limited in my coding skills. So unfortunately I don’t fully understand what you are saying in your email.
My aim is to get my existing watch script to run with a single click in Nova, either with a simple amendment to my watch script, or with a fix in Nova.
Are you suggesting adding an option to Nova's preferences that would disable a line of Nova’s code in order to fix the ‘watch script hanging’ problem?
Brian Liddell
Activity
RyanZim commentedon Jan 29, 2021
Unfortunately, I do not know enough about docker to really help you debug this.
--watchnever exits until it's manually killed; is thedevcommand exiting in docker?dievardump commentedon Jan 29, 2021
Not it's not exiting. It stays open, but never writes the bundle in the output file.
It is as if it's not doing anything, however the same command without
--watchworks perfectly.I just created a repo with the minimal reproducible code, but it's usually in the middle of a stack with Svelte and other watch, but only postcss --watch fails without saying anything.
thought it my be some permissions problem in docker, but even a 777 on the whole project directory does not solve anything.
I guess I could use some other package to watch all
.pcssfiles and recompile on change, but I have always been a postcss lover so if I could make the --watch works, that would be better.I'm going to see if I can dive in the code and maybe get some console to find where it doesn't get things
danoc commentedon May 7, 2021
I'm seeing this as well. In my case, the
postcss ... -w --verbosecommand immediately exits with status code 0 (and no output) if used as withinscriptsin the package.json file. Removing-wcauses it to compile and print an output.Oddly I'm able to get the file watching to work though if I do:
It just isn't working if it's part of the Yarn script that runs when I do
docker-compose up frontend.@dievardump, do you find a fix? I'm going to try
watchas a workaround: https://www.npmjs.com/package/watchbrianliddell commentedon Jun 11, 2021
I'm having the same problem when running NPM PostCSS tasks in Panic's new Nova editor:
The task
npm run watch(which is set to"watch": "postcss site/stylesheets/main.css -o assets/style.css --watch") seems to run, but nothing happens.But, just like the OP, the task
npm run build, or running either of these commands in the macOS Terminal works just fine.Panic's developers have suggested to me that:
I don't have the skills to comment on this diagnosis!
But I'd be grateful for any updates, or suggestions to help resolve this weird issue.
Thanks!
RyanZim commentedon Jun 15, 2021
@dievardump any updates?
RyanZim commentedon Jun 15, 2021
dievardump commentedon Jun 16, 2021
Sorry. I think docker, in some versions, does not implement the "emitting of events when files are modified" that watch uses, which blocks postcss from working there.
that's, if I recall correctly, the conclusion I got from looking around everywhere.
I might be wrong since it was now a few months ago and I just decided to stop using docker for watches
MarcoGlauser commentedon Sep 24, 2021
I noticed the same issue as @danoc and dug a bit further.
By default, docker doesn't open a tty when running a container.
I think this line is causing the immediate exit when docker is started in non-interactive mode. (no stdin/stdout gets allocated)
postcss-cli/index.js
Line 55 in cd5d5df
There's a way around with docker by starting it with the
-itflags that will allocate a tty and stdin/stdout. Or in docker compose settingtty: trueHowever, I think it should be possible to start the watch mode without stdin present, since the watch mode is not really interactive.
RyanZim commentedon Sep 24, 2021
We have this line to allow
^Dto exit watch mode, not sure if it's worth adding an option to disable it, given that there's a workaround in Docker.brianliddell commentedon Sep 24, 2021
only exit on watch if stdin is TTY