Using Docker and Docker Compose, I'm unable to get the webpacker service up and running after upgrading to webpacker 3.3.0. The output after docker-compose up
is:
webpack dev_server configuration not found in /app/config/webpacker.yml.
Please run bundle exec rails webpacker:install to install Webpacker
I've run webpacker:install
- it made changes but the output is the same. I've also run rails new test --webpacker
and compared the configuration files. So far the only notable difference between the working generated app and my own is the Node version. On my local machine in a typical RVM environment the node version is v9.4.0
and in the docker images it's v8.9.3
. Yarn in both environments is 1.3.2
.
My config/webpacker.yml is almost exactly the same as generated. The only difference is a few added extensions:
# Note: You must restart bin/webpack-dev-server for changes to take effect
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
extensions:
- .coffee
- .erb
- .js
- .jsx
- .ts
- .vue
- .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
production:
<<: *default
# Production depends on precompilation of packs prior to booting for performance.
compile: false
# Cache manifest.json for performance
cache_manifest: true
config/webpack/environment.js:
const { environment } = require('@rails/webpacker')
module.exports = environment
config/webpack/development.js:
const environment = require('./environment')
module.exports = environment.toWebpackConfig()
Any ideas as to why it's not finding the dev_server configuration? I don't believe the node version is the reason.