Webpacker: Webpacker not listen for files to compile automatically

Created on 1 Sep 2019  路  6Comments  路  Source: rails/webpacker

Excuse me,
I used docker to build my Rails + Vue + Webpacker.
When I docker-compose up, it is very beautiful to build a good environment with Compiled successfully.

But when I go to modify the file, webpacker does not automatically compile the file.

And in my /public/packs/, there is no compiled file, but the application reads the file.

Is this what is the reason?

please help me

use webpacker (4.0.7)

use webpack-dev-server (3.7.2)

# /config/webpacker.yml


default: &default
  source_path: app/javascript
  source_entry_path: packs
  public_output_path: packs
  cache_path: tmp/cache/webpacker

  # Additional paths webpack should lookup modules
  # ['app/assets', 'engine/foo/app/assets']
  resolved_paths: []

  # Reload manifest.json on all requests so we reload latest compiled packs
  cache_manifest: false

  # Extract and emit a css file
  extract_css: false

  static_assets_extensions:
    - .jpg
    - .jpeg
    - .png
    - .gif
    - .tiff
    - .ico
    - .svg
    - .eot
    - .otf
    - .ttf
    - .woff
    - .woff2

  extensions:
    - .vue
    - .mjs
    - .js
    - .sass
    - .scss
    - .css
    - .module.sass
    - .module.scss
    - .module.css
    - .png
    - .svg
    - .gif
    - .jpeg
    - .jpg

development:
  <<: *default
  compile: true

  # Reference: https://webpack.js.org/configuration/dev-server/
  dev_server:
    https: false
    host: localhost
    port: 3035
    public: localhost:3035
    hmr: false
    # Inline should be set to true if using HMR
    inline: true
    overlay: true
    compress: true
    disable_host_check: true
    use_local_ip: false
    quiet: false
    headers:
      'Access-Control-Allow-Origin': '*'
    watch_options:
      ignored: '**/node_modules/**'


test:
  <<: *default
  compile: true

  # Compile test packs to a separate directory
  public_output_path: packs-test

staging:
  <<: *default
  compile: true

production:
  <<: *default

  # Production depends on precompilation of packs prior to booting for performance.
  compile: false

  # Extract and emit a css file
  extract_css: true

  # Cache manifest.json for performance
  cache_manifest: true

dockeVM

Most helpful comment

i'm using vagrant box and encountered the same problem
please try to add poll: true inside the watch_options

here's mine

  dev_server:
    https: false
    host: 0.0.0.0
    port: 3035
    public: 10.10.10.12:3035
    hmr: true
    # Inline should be set to true if using HMR
    inline: true
    overlay: true
    compress: true
    disable_host_check: true
    use_local_ip: false
    quiet: false
    headers:
      'Access-Control-Allow-Origin': '*'
    watch_options:
      ignored: '**/node_modules/**'
      poll: true

All 6 comments

i'm using vagrant box and encountered the same problem
please try to add poll: true inside the watch_options

here's mine

  dev_server:
    https: false
    host: 0.0.0.0
    port: 3035
    public: 10.10.10.12:3035
    hmr: true
    # Inline should be set to true if using HMR
    inline: true
    overlay: true
    compress: true
    disable_host_check: true
    use_local_ip: false
    quiet: false
    headers:
      'Access-Control-Allow-Origin': '*'
    watch_options:
      ignored: '**/node_modules/**'
      poll: true

@KevinKP17
Thank you!
I'm try it!

@KevinKP17
Excuse me, I found this to be a problem with the docker settings. The problem is solved !

@niusmake
Excuse me, can you tell me how to solve the problem? i meet the same one.

@ndduc0605
Hello
When my solution was very weird, when executing a project docker under a special file name, webpacker not listen for files to compile automatically.
But when I moved to a folder with another file name, he executed it normally.
Hope my solution for your reference.

@niusmake
That solution is not work for me. Anw thank you very much!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iChip picture iChip  路  3Comments

ijdickinson picture ijdickinson  路  3Comments

itay-grudev picture itay-grudev  路  3Comments

towry picture towry  路  3Comments

FrankFang picture FrankFang  路  3Comments