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

No babel-cli watch mode console output after first compilation #7926

Closed
jaydenseric opened this issue May 14, 2018 · 16 comments · Fixed by #11220
Closed

No babel-cli watch mode console output after first compilation #7926

jaydenseric opened this issue May 14, 2018 · 16 comments · Fixed by #11220
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@jaydenseric
Copy link

Bug Report

Current Behavior

The babel-cli in --watch mode does not output any messages following the first compilation. It seems as though the CLI is not doing anything even though files are compiling.

Input Code

babel src -d lib --watch

Expected behavior/code

The CLI should display an output summary after every --watch mode compilation.

Babel Configuration (.babelrc, package.json, cli command)

N/A.

Environment

  • Babel version(s): v7.0.0-beta.41 - v7.0.0-beta.46
  • Node/npm version: Node 10/npm 6
  • OS: macOS v10.13.4
  • Monorepo: No
  • How you are using Babel: cli

Possible Solution

Additional context/Screenshots

This issue began with #7439 in v7.0.0-beta.41. The babel-cli has a new a new --verbose flag for seeing exactly what files were compiled, but even with the verbose output of what files are being compiled there are no subsequent summary messages. An output summary should be displayed every compilation, regardless of the --verbose flag.

@babel-bot
Copy link
Collaborator

Hey @jaydenseric! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.

@m0onspell
Copy link

Still isn't fixed. Very confusing.

@wintercounter
Copy link

I'm running babel-cli with spawn. I need the success messages to trigger some actions after success. Now there's no way to do that.

@itsjoekent
Copy link

Ooof just noticed this as well, very bizarre.

@ersinakinci
Copy link

Any updates on this? Or workarounds?

@johnsogg
Copy link

As a rough workaround I use --verbose, e.g.:

babel ./src --watch --out-dir dest --extensions '.ts,.tsx' --verbose

It will report modified and output files now, so at least I can see that it picks up changes and does something. I'd like a "Compilation OK" or something happy like that, but I'll take "src/index.ts -> dest/index.js" until then.

@wintercounter
Copy link

The issue with that in my case that multiple files can be changed at the same time and I won't know for sure if compilation is finished or not because I dont know the exact number of files changed.

@yairEO
Copy link

yairEO commented Jun 30, 2019

Happens also on my Mac, using

"@babel/cli": "^7.4.4",
"@babel/core": "^7.4.5"

Nothing is printed after the initial run, although I clearly see Babel works and files are being transpiled into the /dist folder. very odd.

My package.json start script:

rimraf dist    &&    babel src --out-dir dist --copy-files --ignore \"src/**/*.spec.js\",\"src/**/*.test.js\" --verbose --source-maps inline --watch & npm run sass:watch

@torressam333
Copy link

Was this ever resolved? I am having this exact issue right now.
Thank you.

@origamisith
Copy link

This same issue came up in an online class I'm taking. The instructor, Andrew Mead, came up with a workaround using Chokidar from npm. Simply add this to the beginning of the babel command: CHOKIDAR_USEPOLLING=true
This might just be an issue with Linux users.

@wintercounter
Copy link

wintercounter commented Aug 28, 2019 via email

@josias-r
Copy link

josias-r commented Feb 7, 2020

Also, the non-watch mode has some colours for paths i.E, when errors appear. Would be nice if the Cli would do it similarly.

@novendi
Copy link

novendi commented Feb 7, 2020

Duplicate of #

@switz
Copy link

switz commented Mar 5, 2020

Sorry for the additional "+1" message, but this would be really handy to have. It's rough UX without it. If someone wants to point me in the direction of where I might implement this, I'm happy to send a PR.

edit: This PR seems to accomplish what we're looking for. https://github.com/babel/babel/pull/6320/files

@dman777
Copy link

dman777 commented Mar 16, 2020

This same issue came up in an online class I'm taking. The instructor, Andrew Mead, came up with a workaround using Chokidar from npm. Simply add this to the beginning of the babel command: CHOKIDAR_USEPOLLING=true
This might just be an issue with Linux users.

probably best to export it as in export CHOKIDAR_USEPOLLING=true

@nicotroia
Copy link

Currently running

"@babel/cli": "^7.8.4",
"@babel/core": "^7.9.6",

babel ./src --watch --out-dir ./dist

and nothing outputs besides a single Successfully compiled 7 files with Babel.

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Aug 24, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.