question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not watch in docker

See original GitHub issue

Environment

  • Node Version: 9.4.0
  • Eslint-Watch Version: 3.1.3
  • Eslint Version: 4.17.0

Basic Description of the problem

Does not watch when using in node image of docker.

How to reproduce it

  1. Command: esw ./ --cache --ext .js -w --color

Debug output:

// to grab debug output set DEBUG=esw:*
  esw:internal-settings Eslint installed locally node_modules/.bin/eslint +0ms
  esw:internal-settings { eslintPath: 'node_modules/.bin/eslint',
  esw:internal-settings   platform: 'linux',
  esw:internal-settings   isWindows: false } +2ms
  esw:eslint-cli Loaded +0ms
  esw:eslint-help Loaded +0ms
  esw:options Loaded +0ms
  esw:eslint-help Executing help +1ms
  esw:eslint-cli eslint: '--help' +18ms
  esw:executor node_modules/.bin/eslint [ '--help' ] +0ms
  esw:eslint-cli { exitCode: 0,
  esw:eslint-cli   message: 'eslint [options] file.js [file.js] [dir]\n\nBasic configuration:\n  --no-eslintrc                  Disable use of configuration from .eslintrc.*\n  -c, --config path::String      Use this configuration, overriding .eslintrc.* config options if present\n  --env [String]                 Specify environments\n  --ext [String]                 Specify JavaScript file extensions - default: .js\n  --global [String]              Define global variables\n  --parser String                Specify the parser to be used\n  --parser-options Object        Specify parser options\n\nSpecifying rules and plugins:\n  --rulesdir [path::String]      Use additional rules from this directory\n  --plugin [String]              Specify plugins\n  --rule Object                  Specify rules\n\nFixing problems:\n  --fix                          Automatically fix problems\n  --fix-dry-run                  Automatically fix problems without saving the changes to the file system\n\nIgnoring files:\n  --ignore-path path::String     Specify path of ignore file\n  --no-ignore                    Disable use of ignore files and patterns\n  --ignore-pattern [String]      Pattern of files to ignore (in addition to those in .eslintignore)\n\nUsing stdin:\n  --stdin                        Lint code provided on <STDIN> - default: false\n  --stdin-filename String        Specify filename to process STDIN as\n\nHandling warnings:\n  --quiet                        Report errors only - default: false\n  --max-warnings Int             Number of warnings to trigger nonzero exit code - default: -1\n\nOutput:\n  -o, --output-file path::String  Specify file to write report to\n  -f, --format String            Use a specific output format - default: stylish\n  --color, --no-color            Force enabling/disabling of color\n\nInline configuration comments:\n  --no-inline-config             Prevent comments from changing config or rules\n  --report-unused-disable-directives  Adds reported errors for unused eslint-disable directives\n\nCaching:\n  --cache                        Only check changed files - default: false\n  --cache-file path::String      Path to the cache file. Deprecated: use --cache-location - default: .eslintcache\n  --cache-location path::String  Path to the cache file or directory\n\nMiscellaneous:\n  --init                         Run config initialization wizard - default: false\n  --debug                        Output debugging information\n  -h, --help                     Show help\n  -v, --version                  Output the version number\n  --print-config path::String    Print the configuration for the given file\n' } +210ms
  esw:eslint-help Parsing --no-eslintrc +212ms
  esw:eslint-help Parsing no option --no-eslintrc +1ms
  esw:eslint-help Alias found: -c +0ms
  esw:eslint-help Parsing --config +0ms
  esw:eslint-help Parsing --env +1ms
  esw:eslint-help Parsing --ext +0ms
  esw:eslint-help Parsing --global +0ms
  esw:eslint-help Parsing --parser +0ms
  esw:eslint-help Parsing --parser-options +0ms
  esw:eslint-help Parsing --rulesdir +0ms
  esw:eslint-help Parsing --plugin +0ms
  esw:eslint-help Parsing --rule +0ms
  esw:eslint-help Parsing --fix +1ms
  esw:eslint-help Parsing --fix-dry-run +0ms
  esw:eslint-help Parsing --ignore-path +0ms
  esw:eslint-help Parsing --no-ignore +0ms
  esw:eslint-help Parsing no option --no-ignore +0ms
  esw:eslint-help Parsing --ignore-pattern +0ms
  esw:eslint-help Parsing --stdin +0ms
  esw:eslint-help Parsing --stdin-filename +0ms
  esw:eslint-help Parsing --quiet +1ms
  esw:eslint-help Parsing --max-warnings +0ms
  esw:eslint-help Alias found: -o +0ms
  esw:eslint-help Parsing --output-file +0ms
  esw:eslint-help Alias found: -f +0ms
  esw:eslint-help Parsing --format +0ms
  esw:eslint-help Parsing --no-inline-config +0ms
  esw:eslint-help Parsing no option --no-inline-config +0ms
  esw:eslint-help Parsing --report-unused-disable-directives +0ms
  esw:eslint-help Parsing --cache +0ms
  esw:eslint-help Parsing --cache-file +0ms
  esw:eslint-help Parsing --cache-location +1ms
  esw:eslint-help Parsing --init +0ms
  esw:eslint-help Parsing --debug +0ms
  esw:eslint-help Alias found: -h +0ms
  esw:eslint-help Parsing --help +0ms
  esw:eslint-help Alias found: -v +0ms
  esw:eslint-help Parsing --version +0ms
  esw:eslint-help Parsing --print-config +0ms
  esw:watcher Loaded +0ms
  esw:arg-parser Loaded +0ms
  esw:esw-cli Loaded +0ms
  esw:esw-cli Eslint-Watch: 3.1.3 +0ms
  esw:esw-cli Arguments passed: [ '/usr/local/bin/node', '/root/project/node_modules/.bin/esw', './', '--cache', '--ext', '.js', '-w', '--color' ] +0ms
  esw:esw-cli Parsing args +2ms
  esw:arg-parser Directories to check: [ './' ] +4ms
  esw:arg-parser Args [ './', '--cache', '--ext', '.js', '-w', '--color' ] +0ms
  esw:arg-parser Pushing item: ./ +0ms
  esw:arg-parser Pushing item: --cache +0ms
  esw:arg-parser Pushing item: --ext +0ms
  esw:arg-parser Pushing item: .js +1ms
  esw:arg-parser Pushing item: --color +0ms
  esw:arg-parser setting custom formatter +0ms
  esw:arg-parser GetPath: simple-detail +0ms
  esw:arg-parser /root/project/node_modules/eslint-watch/build/formatters/simple-detail +0ms
  esw:esw-cli Running initial lint +2ms
  esw:esw-cli [ './',
  esw:esw-cli   '--cache',
  esw:esw-cli   '--ext',
  esw:esw-cli   '.js',
  esw:esw-cli   '--color',
  esw:esw-cli   '-f',
  esw:esw-cli   '/root/project/node_modules/eslint-watch/build/formatters/simple-detail' ] +0ms
  esw:eslint-cli eslint: './ --cache --ext .js --color -f /root/project/node_modules/eslint-watch/build/formatters/simple-detail' +142ms
  esw:executor node_modules/.bin/eslint [ './',
  '--cache',
  '--ext',
  '.js',
  '--color',
  '-f',
  '/root/project/node_modules/eslint-watch/build/formatters/simple-detail' ] +350ms
  esw:simple-detail loaded +0ms
  esw:simple-detail [ { filePath: '/root/project/.eslintrc.js',
  esw:simple-detail     messages: [],
  esw:simple-detail     errorCount: 0,
  esw:simple-detail     warningCount: 0,
  esw:simple-detail     fixableErrorCount: 0,
  esw:simple-detail     fixableWarningCount: 0 },
  // too many detail, I remove those.
✓ Clean (17:21:21)
  esw:eslint-cli { exitCode: 0, message: '' } +2s
  esw:esw-cli lint completed. Exit Code: 0 +2s

  esw:esw-cli -w seen +2ms
  esw:watcher { useEslintrc: true,
  esw:watcher   extensions: [ '.js' ],
  esw:watcher   cache: true,
  esw:watcher   ignore: true,
  esw:watcher   format: 'simple-detail' } +2s
  esw:watcher { cache: true,
  esw:watcher   ext: [ '.js' ],
  esw:watcher   watch: true,
  esw:watcher   color: true,
  esw:watcher   format: 'simple-detail',
  esw:watcher   eslintrc: true,
  esw:watcher   ignore: true,
  esw:watcher   inlineConfig: true,
  esw:watcher   _: [ './' ] } +0ms
  esw:watcher Trying to load formatter for re-lint from ./formatters/simple-detail +12ms
  esw:simple-detail loaded +0ms
  esw:watcher Watching: [ './' ] +15ms

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
HsuTingcommented, Feb 21, 2018

I know. I just want to give more detail to you.

0reactions
HsuTingcommented, Feb 22, 2018

I use another way to test.

  1. docker run -it node:latest /bin/bash
  2. git clone <eslint-watch repo>
  3. apt update and apt install -y vim
  4. npm i -g eslint eslint-watch
  5. Copy tests and package.json to new folder, and run npm i in new folder.
  6. esw ./ --cache --ext .js -w --color
  7. Open a new CMD and run docker exec -it <container id> bash.
  8. Edit files in tests.

This does not work again. Is exec to make this bug?

Read more comments on GitHub >

github_iconTop Results From Across the Web

File system watch does not work with mounted volumes
Steps to reproduce the behavior. mount a volume, like so: docker run -ti -v C:\proj:/app <your_image> /bin/bash; Install ...
Read more >
Watch fails silently in docker node:lts · Issue #370 - GitHub
I have a problem with postcss-cli which doesn't work in watch mode in a node docker image Here is a minimal repo that...
Read more >
NestJS not watching in docker - Stack Overflow
Since upgrading Docker Desktop for Windows recently, my nest start --watch stopped working. It is not reloading anymore for changes (not ...
Read more >
How to Enable Live-reload on Docker-based Applications with ...
In this post you'll learn how to configure a development environment with live-reload enabled. This will allow you to convert a legacy ...
Read more >
Do NOT Use Docker Compose! Develop In Kubernetes (With ...
Development and preview environments should be similar to production. If production is in Kubernetes, development should not be managed by ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found