Skip to content

bin/webpack-dev-server is not compiling issues on the fly #2512

@kritik

Description

@kritik

bin/webpack-dev-server used to on all projects but on the new rails installation it stopped working at all. I removed all yarn including home directory settings. Then reinstalled yarn via brew.

To show my issue I created new rails application https://github.com/kritik/webpacker-dev-server via:

rails new project name
yarn set version 1.22.0
yarn install
rails g scaffold page name
rails db:migrate

After that I run in 1 tab rails s and in second one bin/webpacker-dev-server. Logs:

$ bin/webpack-dev-server 
ℹ 「wds」: Project is running at http://localhost:3035/
ℹ 「wds」: webpack output is served from /packs/
ℹ 「wds」: Content not from webpack is served from /Users/Vladimir/rails/familyid/invitations/public/packs
ℹ 「wds」: 404s will fallback to /index.html
ℹ 「wdm」: Hash: 8c0082807459236a9b6e
Version: webpack 4.42.1
Time: 2213ms
Built at: 03/26/2020 5:38:49 PM
                                     Asset       Size       Chunks                         Chunk Names
    js/application-f6c46fa6637e924c53df.js    506 KiB  application  [emitted] [immutable]  application
js/application-f6c46fa6637e924c53df.js.map    571 KiB  application  [emitted] [dev]        application
      js/hello_vue-eb2815a0b48aa2fc5e72.js    648 KiB    hello_vue  [emitted] [immutable]  hello_vue
  js/hello_vue-eb2815a0b48aa2fc5e72.js.map    744 KiB    hello_vue  [emitted] [dev]        hello_vue
                             manifest.json  689 bytes               [emitted]              
ℹ 「wdm」: Compiled successfully.

Then I go to the page http://localhost:3000/pages and see in the console

Loading failed for the <script> with source “http://localhost:3000/packs/js/application-f6c46fa6637e924c53df.js”.

When I checked public folder then nothing generated there

$ find public/packs
public/packs
public/packs/manifest.json
$ 

The most interesting part is that if I kill webpack-dev-server and restart rails, so compilation happens in the same window, then everything works fine and pack files are compiled.

Any idea where should I dig?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions