Browser returns 404 error when running Webpack dev server

Viewed 941

I'm using Rails 6 with webpacker on a remote server.

When running bin/webpack-dev-server, it returns :

ℹ 「wds」: Project is running at https://MY_HOST:3035/
ℹ 「wds」: webpack output is served from /packs/
ℹ 「wds」: Content not from webpack is served from /PATH/public/packs
ℹ 「wds」: 404s will fallback to /index.html`

When visiting the URL, the pack URL returns a 404 error :

https://MY_HOST/packs/js/application-HASH.js net::ERR_ABORTED 404 (Not Found)

It works fine when I'm using bin/webpack --watch

Here is the dev_server configuration :

dev_server:
    https: true
    host: '0.0.0.0'
    port: 3035
    public: MY_HOST: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
    pretty: false
    headers:
      'Access-Control-Allow-Origin': '*'
    watch_options:
      ignored: '**/node_modules/**'

The manifest.json hashes are the same as what the webpack dev server generates.

I can't seem to understand what is the issue.

I would really appreciate any pointers.

0 Answers
Related